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

spider_campaigns_yesterday.rb is missing from the v201402 examples #21

Closed
barttenbrinke opened this issue Apr 8, 2014 · 3 comments
Closed

Comments

@barttenbrinke
Copy link

As this is probably what a lot of people are doing - looking at the costs & clicks of their campaign for specific dates, it would be nice to get this back. I'm having real difficulties getting the stats. I understand that they have been moved to Reporting, but an example that actually fetches data instead of downloading a file would really help.

@TigerWolf
Copy link

This example might help: https://gist.github.com/TigerWolf/8954e4be982be4c68280

The API only handles the downloading, the importing is up to you and will be very specific to your application.

@barttenbrinke
Copy link
Author

Let me rephrase this:

a use case I encounter a lot (and I think a lot of other people will as well), is to find the campaings for an account that where active yesterday, and to drill down from that point.

In v201309 it was very easy and cheap to do this:
Taking the example of spider_campaigns_yesterday:

selector = {
    :fields => ['Id', 'Name', 'Impressions', 'Clicks', 'Cost', 'Ctr'],
    :predicates => [
      {:field => 'Impressions', :operator => 'GREATER_THAN', :values => [0]}
    ],
    :date_range => {:min => start_date, :max => end_date},
    :paging => {
      :start_index => 0,
      :number_results => PAGE_SIZE
    },
  }

It's easy to adapt to check if campaings have costs or clicks and to continue from there.
In v201402, this is no longer possible, because these columns have been deprecated.

I've fixed this in my app by using the reporting api, but this was non-trivial and is a lot slower.

It think it would be a good idea to al least point users in the right direction by having a v201402/reporting/spider_campaings_yesterday.rb that has the same result as the v201309 version, but by using the reporting api. This will help exiting users migrate and new user to get their active campaigns.

@mcloonan
Copy link
Member

We are considering the possibility of adding extra utilities along with the client library, including something that will help to parse report results. I'm going to close this ticket, because we are keeping track of it internally.

This does not guarantee that the request will be built, but it is something we are thinking about.

Thanks for the idea!

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

3 participants