campaign segments by date only

33 views
Skip to first unread message

lin joinf

unread,
Oct 27, 2021, 4:39:59 AM10/27/21
to AdWords API and Google Ads API Forum
String query = " SELECT metrics.average_cost, metrics.average_cpc, metrics.average_cpe, metrics.average_cpm, metrics.average_cpv, metrics.average_page_views, " +
"metrics.average_time_on_site, segments.date " +
"FROM campaign " +
"WHERE campaign.advertising_channel_type = 'SEARCH' and segments.date BETWEEN '2021-10-19' AND '2021-10-21' ";

when i seach by this query the result is:
-------------
campaign {
  resource_name: "customers/3280624166/campaigns/13813170170"
}
metrics {
  average_cost: 1.244E7
  average_cpc: 1.244E7
  average_cpm: 1.5170731707317073E9
  average_page_views: 2.1666666666666665
  average_time_on_site: 233.83333333333334
}
segments {
  date: "2021-10-21"
}

------------

campaign {
  resource_name: "customers/3280624166/campaigns/14755251085"
}
metrics {
  average_cpm: 0.0
}
segments {
  date: "2021-10-21"
}

the result is segments by date and campaign  ;
how can i segments by date only?
when the date = "2021-10-21"  has one result no two

Google Ads API Forum Advisor

unread,
Oct 27, 2021, 4:55:57 PM10/27/21
to redn...@tom.com, adwor...@googlegroups.com

Hello,

 

Thanks for reaching out to the Google Ads API support team. With regards to your concern “how can i segments by date only?” – Please note that any resource that you specify in the FROM clause will segment the report. If you do not want your report segmented by campaign, and you do want an account-wide report, you can use the customer resource.

 

Please let me know if you have any questions on this.

 

Best regards,

Google Logo
Jakeia Sabrina
Google Ads API Team
 

ref:_00D1U1174p._5004Q2QFaKd:ref

lin joinf

unread,
Oct 27, 2021, 10:09:33 PM10/27/21
to AdWords API and Google Ads API Forum
Tanks
I can use   customer resource. but can not filter by  campaign.advertising_channel_type at the same time!

Google Ads API Forum Advisor

unread,
Oct 28, 2021, 9:36:48 AM10/28/21
to redn...@tom.com, adwor...@googlegroups.com
Hello,

That's correct, the customer resource does not have an advertising channel subtype segment. The campaign resource does have this segment, but, as mentioned by Jakeia, this resource will impilicity segment the data, as it is the resource specified in the FROM clause. 

You can read more about implicit segmentation here.

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


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