Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the total spent amount for a campaign? #281

Open
phillipmohr opened this issue Mar 23, 2024 · 0 comments
Open

How to get the total spent amount for a campaign? #281

phillipmohr opened this issue Mar 23, 2024 · 0 comments

Comments

@phillipmohr
Copy link

I'm trying to get the total amount that has been spent for a specific campaign. How can I do that?

Which SDK version are you using?

const insightsPromise = new Campaign(campaignId).getInsights([AdsInsights.Fields.ad_name, AdsInsights.Fields.spend]);

What's the issue?

When I access the spend field, it only returns a value if the campaign is still active. If the campaign is inactive, I do not get a value.

My approach:

const adSetsPromise = new Campaign(campaignId).getAdSets([AdSet.Fields.id, AdSet.Fields.daily_budget, AdSet.Fields.lifetime_budget]);

Expected Results:

  • What did you expect to happen?

Get the total amount spent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant