Aggregated Campaign Data

46 views
Skip to first unread message

Dan Williams

unread,
Nov 10, 2022, 9:56:26 AM11/10/22
to Google Ads API and AdWords API Forum
Hello

I want to get hour of day data for campaigns with names containing certain phrases.

My current query is: 
SELECT segments.hour,  metrics.clicks, metrics.conversions_value,metrics.cost_micros, metrics.conversions FROM campaign WHERE campaign.name REGEXP_MATCH '.*{CAMPAIGN_CONTAINS}.*' AND segments.date BETWEEN {STARTDATE} AND ${ENDDATE} 

Despite the fact that I am not including campaign.name or campaign.id in the query, the rows that are returned are split by campaign. I don't want this. I want them to be grouped. 

I tried to see if I could get this data from the customer report type but you predictably can't apply campaign.name filters on a campaign report. 

Do I just need to give up and aggregate the data myself?  

Google Ads API Forum Advisor

unread,
Nov 10, 2022, 1:52:36 PM11/10/22
to adwor...@googlegroups.com
Hi,

Thank you for raising this concern to the Google Ads API Forum.

With regard to your concern, I am afraid that the use case that you are looking for in the Google Ads API is not possible, let me explain why. For the campaign report, it is default segmented by campaign resource even though, you are not adding campaign name and campaign Id fields. This report will just further breakdown when you add  segments.hours field by hours.

As for the customer report type, this is also not possible for the reason that you can't filter it by campaign name. With this, I would suggest to aggregate the data on your end and after that report has been downloaded. 

Best regards,
Google Logo
Jinky
Google Ads API Team
 


ref:_00D1U1174p._5004Q2g2PP1:ref
Reply all
Reply to author
Forward
0 new messages