Changed behavior re date fields and zero impressions

58 views
Skip to first unread message

GD

unread,
Jul 7, 2015, 8:43:06 AM7/7/15
to adwor...@googlegroups.com
Hi!

I think you (accidentally?) changed the behavior regarding Date field in KPR visavi zero impression rows.

See below examples:

In [34]: report_downloader.DownloadReportAsStreamWithAwql(
            'SELECT CampaignId, AdGroupId, Id, Date FROM KEYWORDS_PERFORMANCE_REPORT DURING 20150707,20150707', file_format='CSV').readlines()[0:5]

Out[34]:
['"KEYWORDS_PERFORMANCE_REPORT (Jul 7, 2015)"\n',
 'Campaign ID,Ad group ID,Keyword ID,Day\n',
 'Total, --, --, --\n']

If we remove Date from the query, we get many lines


In [35]: report_downloader.DownloadReportAsStreamWithAwql(
            'SELECT CampaignId, AdGroupId, Id FROM KEYWORDS_PERFORMANCE_REPORT DURING 20150707,20150707', file_format='CSV').readlines()[0:5]
Out[35]:
['"KEYWORDS_PERFORMANCE_REPORT (Jul 7, 2015)"\n',
 'Campaign ID,Ad group ID,Keyword ID\n',
 '263993268,9713724108,50982934788\n',
 '263991948,9713602068,3001111864\n',
 '156554148,6752305908,50981848068\n']

This used to produce the same answer. Is this something you could fix or is this the new normal? In that case, Docs should be updated so that it states Date does not support zero impression rows.

Nadine Sundquist (AdWords API Team)

unread,
Jul 7, 2015, 1:34:01 PM7/7/15
to adwor...@googlegroups.com, gus...@solutions.se
Hello,

Thanks for pointing this out. The behavior you're showing and the documentation definitely don't match. I'll talk to the engineers to see what the intended behavior is, and I'll get back to you as soon as I have news. 

Best,
Nadine, AdWords API Team

Nadine Sundquist (AdWords API Team)

unread,
Jul 7, 2015, 1:55:24 PM7/7/15
to adwor...@googlegroups.com, adwordsapiad...@google.com, gus...@solutions.se
Hi,

With the Keywords Performance Report, you need to have at least one field with the Behavior of type Metric such as the Impressions field. Can you please give that a try to see if things behave as expected?

Thanks,
Nadine, AdWords API Team 

GD

unread,
Jul 8, 2015, 7:32:53 AM7/8/15
to adwor...@googlegroups.com, gus...@solutions.se
Hi Nadine,

While this is certainly a solution, what I'm trying to point out above is that the behavior changed. We were using these calls to generate reports about the account structure and thus dont want to use metric fields. Before, you could request such reports with Date, now you cant?

Nadine Sundquist (AdWords API Team)

unread,
Jul 8, 2015, 10:30:11 AM7/8/15
to adwor...@googlegroups.com, gus...@solutions.se
Hello,

With a bit of experimentation, I was able to figure out what was going on. Specify your query just as you did before. However, you will need to explicitly set includeZeroImpressions to true in the header of the request. Your data will then appear. It looks like you're using Python, so here's a Python example of setting those headers:

  with open(path, 'w') as output_file:
    report_downloader.DownloadReportWithAwql(
        report_query, 'CSV', output_file, skip_report_header=False,
        skip_column_header=False, skip_report_summary=False,
        include_zero_impressions=True)

If you're using another language, check out our client library examples for v201506 to see how to set headers when downloading reports.

Happy coding,
Nadine, AdWords API Team

GD

unread,
Jul 8, 2015, 11:24:15 AM7/8/15
to adwor...@googlegroups.com, gus...@solutions.se
Thank you, Nadine!

That does not explain what changed, but surely it is a solution :)

Also note that the source code at https://github.com/googleads hasn't been updated to the latest version, which creates some potential for confusion.

GD

unread,
Jul 8, 2015, 11:24:25 AM7/8/15
to adwor...@googlegroups.com, gus...@solutions.se
Thank you, Nadine!

That does not explain what changed, but surely it is a solution :)

Also note that the source code at https://github.com/googleads hasn't been updated to the latest version, which creates some potential for confusion.

Nadine Sundquist (AdWords API Team)

unread,
Jul 8, 2015, 1:11:45 PM7/8/15
to adwor...@googlegroups.com, gus...@solutions.se
Hello,

I'm happy to hear that the solution gets you going again! 

The source code on Github (except for Python) was updated in the first week of July for the v201506 release. Be on the lookout for the new Python code on Github within the next week. In the meantime, you can download the newest version (for v201506) of the Python client library on PyPI. 

Regards,
Nadine, AdWords API Team
Reply all
Reply to author
Forward
0 new messages