Date or device report only for some specific campaigns on Google Ads API beta

44 views
Skip to first unread message

hiromi hishida

unread,
May 27, 2018, 9:51:06 PM5/27/18
to AdWords API and Google Ads API Forum
Hello,

Some of our customers need date or device segmented report only for some specific campaigns.

For example, when the raw data is look like this:
Campaign, Date, Impressions
A01_Campaign1, 2018-05-01, 100
A01_Campaign2, 2018-05-01, 50
B01_Campaign3, 2018-05-01, 60
A01_Campaign1, 2018-05-02, 200
A01_Campaign2, 2018-05-02, 50
B01_Campaign3, 2018-05-02, 60

The desired output is like this:
Date, Impressions
2018-05-02, 150
2018-05-02, 250

In current AdWords API, this kind of reports are not supported, I suppose.
(I am doing this manually from CAMPAIGN_PERFORMANCE_REPORT)

New Google Ads API beta seems to support this. (I read through https://developers.google.com/google-ads/api/docs/fields/v0/campaign#campaignname and found campaign.name marked as Filterable.)
So I tried Google Ads Query Language with Ruby sdk.

query: SELECT date, metrics.impressions FROM customer WHERE date DURING LAST_30_DAYS AND campaign.name LIKE 'A01%'
result(error message): The following field must be present in SELECT clause: 'campaign.name'.

query: SELECT date, metrics.impressions, campaign.name FROM customer WHERE date DURING LAST_30_DAYS AND campaign.name LIKE 'A01%'
result(error message): Cannot select fields from the following resource: 'CAMPAIGN', since the resource is incompatible with the resource in FROM clause.

query: SELECT campaign.name, date, metrics.impressions FROM campaign WHERE date DURING LAST_30_DAYS AND campaign.name LIKE 'A01%'
result: Succeeded, but the output was not what I expected.
Campaign, Date, Impressions
A01_Campaign1, 2018-05-01, 100
A01_Campaign2, 2018-05-01, 50
A01_Campaign1, 2018-05-02, 100
A01_Campaign2, 2018-05-02, 50

I want GAQL to support queries like following:
"SELECT date, metrics.impressions FROM customer WHERE date DURING LAST_30_DAYS AND campaign.name LIKE 'A01%'"
or
"SELECT campaign.name, date, metrics.impressions FROM campaign WHERE date DURING LAST_30_DAYS AND campaign.name LIKE 'A01%' GROUP BY campaign.name"


I posted the same question on the Webinar last week, and Adam told me to post here for troubleshooting.
Can anybody help?

Luis Xander Talag (AdWords API Team)

unread,
May 28, 2018, 3:20:22 AM5/28/18
to AdWords API and Google Ads API Forum
Hi Hiromi,

My apologies as currently, the GROUP BY clause is not supported in the Google Ads Query Language. This Query Grammar reference shows what is available in GAQL. I can't comment on if and when this feature will be added but, you may follow on our blog for any updates regarding this.

Thanks and regards,
Luis
AdWords API Team

hiromi hishida

unread,
May 28, 2018, 7:54:26 AM5/28/18
to AdWords API and Google Ads API Forum
Hi Luis, thank you for your reply.
Looking forward to good news.



2018年5月28日月曜日 16時20分22秒 UTC+9 Luis Xander Talag (AdWords API Team):
Reply all
Reply to author
Forward
0 new messages