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

Get Amount spend from campaign #35

Closed
Michael3434 opened this issue Dec 1, 2017 · 4 comments
Closed

Get Amount spend from campaign #35

Michael3434 opened this issue Dec 1, 2017 · 4 comments
Labels

Comments

@Michael3434
Copy link

Hey, I cannot get from a campagin the amount spend.
I tryed many fields ( dayli_spend, spend, amount spend etc.. ) :
undefined method `amount_spent' for #FacebookAds::Campaign:0x007f8903ae49b0
Any ideas ?

Thanks :)

@Michael3434 Michael3434 changed the title Amount spend Get Amount spend from campaign Dec 1, 2017
@ssankim
Copy link

ssankim commented Aug 9, 2018

You can get amount spent on campaign from insight data like below.

campaign = FacebookAds::Campaign.get(<CAMPAIGN_ID>)
campaign.insights(date_preset: "lifetime", fields: "spend").first
=> #<FacebookAds::AdsInsights {:spend=> <SPEND>, :date_start=> <START_DATE>, :date_stop=> <STOP_DATE>}>

@aarhusgregersen
Copy link

I can confirm that this works :-)

@stale
Copy link

stale bot commented Jan 14, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Jan 14, 2020
@stale
Copy link

stale bot commented Jan 21, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants