Getting report totals in new Google Ads API

1,136 views
Skip to first unread message

Francis Moore

unread,
Dec 12, 2018, 3:21:54 PM12/12/18
to AdWords API and Google Ads API Forum
Hi all,

I'm looking for a way to get the totals for the metrics of a report in the Google Ads Beta API. It is available in the current AdWords API with the CSV format, but not with the XML format.

In the Google Ads API, it does not look to be available in the response, since all we get is an array of GoogleAdsRow

I could of course just sum up the values, but many metrics just can't summed up like that, for example Search Impression Share. 

Any idea? Thanks!

Luis Xander Talag (AdWords API Team)

unread,
Dec 12, 2018, 9:36:06 PM12/12/18
to AdWords API and Google Ads API Forum
Hi Francis,

I'm afraid the totals for metric values in reports in Google Ads API Beta is not yet supported and is currently available only in AdWords API using the skipReportSummary HTTP request value. I could not comment on if and when this feature will be supported in Google Ads API Beta. However, you may follow our blog for any updates on this.

Thanks and regards,
Luis
AdWords API Team

Dorian Kind

unread,
May 24, 2019, 10:14:38 AM5/24/19
to AdWords API and Google Ads API Forum
Hi,

just wanted to follow up on this.

A reporting use case that we encounter quite frequently is to aggregate metrics for a specific set of campaigns of an account (e.g. "How are all my campaigns for product X doing?"). With the Adwords API, we can use the campaign report, set up appropriate filters and use the summary row of the report directly.

As Francis mentions, the complexity and feasibility of calculating totals on our end depends a lot on the chosen metrics. While it's simple to aggregate clicks, I wouldn't know how to calculate the total "Search lost absolute top impression share" for a subset of campaigns of an account—I'd assume it's weighted by impressions, but I don't think this is documented anywhere.

Thus, having a summary row available in the response of the GoogleAdsService.Search endpoint is essential for us.

Thanks and best regards,
Dorian

Google Ads API Forum Advisor Prod

unread,
May 24, 2019, 4:54:12 PM5/24/19
to adwor...@googlegroups.com
Hello Dorian,

I understand your concern. I will let my team know and update you when I have more information.

Regards,
Sai Teja, Google Ads API Team

ref:_00D1U1174p._5001UAqWq9:ref

Dorian Kind

unread,
Dec 31, 2019, 3:16:32 AM12/31/19
to AdWords API and Google Ads API Forum
Hi there,

sorry to ressurect such an old thread, but I just wanted to inquire whether this feature has been added or is being considered for addition to the Google Ads API in the meanwhile.

Thanks & best regards,
Dorian

Google Ads API Forum Advisor Prod

unread,
Jan 2, 2020, 12:23:45 PM1/2/20
to dor...@webrepublic.ch, adwor...@googlegroups.com

Hi Dorian,

I am Nikisha from Google Ads API team. Please allow me to support your concerns in the absence of my colleague Sai.

A feature request for your concern has already been created internally within our team, however, we do not have any timeline to share when this feature will be available. Please keep an eye on our blog post for further updates and announcements related to this.

Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UAqWq9:ref

Luis Pandolfi

unread,
Apr 22, 2021, 11:55:23 AM4/22/21
to AdWords API and Google Ads API Forum
Hi, sorry to resurect an old thread, but I still have the same questions.

I would like to know if currently there is some way to get the report summary using Google Ads API, otherwise if there is some concrete plan to include this and estimated time.

Best regards,
Luis Pandolfi

Google Ads API Forum Advisor Prod

unread,
Apr 22, 2021, 10:50:55 PM4/22/21
to luispa...@gmail.com, adwor...@googlegroups.com
Hi Luis,

Thank you for coming back to us.

Getting the summary of the report is now supported in Google Ads API reporting. You will just need to configure the summary_row_setting of the GoogleAdsService.Search or summary_row_setting of GoogleAdsService.SearchStream in order to do this.

Let me know if you have further questions.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5001UAqWq9:ref

stefano...@webrepublic.ch

unread,
Apr 23, 2021, 1:13:33 AM4/23/21
to AdWords API and Google Ads API Forum
Hi Luis,


Cheers,
Stefano

Google Ads API Forum Advisor Prod

unread,
Apr 23, 2021, 9:28:10 AM4/23/21
to stefano...@webrepublic.ch, adwor...@googlegroups.com

Hi Stefano,

Thank you for sharing the information to help out other people.
 

- Luis,

Let us know if you have any further questions.
 

Thanks and regards,
Xiaoming, Google Ads API Team



Google Logo
Xiaoming
Google Ads API Team
 


ref:_00D1U1174p._5001UAqWq9:ref

นางสาวอรุณรักษ์ บุญลือ

unread,
Apr 23, 2021, 9:45:48 AM4/23/21
to adsapifor...@gmail.com, Stefano Fontana, adwor...@googlegroups.com

ในวันที่ ศ. 23 เม.ย. 2021 20:27 Google Ads API Forum Advisor Prod <adsapifor...@gmail.com> เขียนว่า:
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/9erlt000000000000000000000000000000000000000000000QS0QQD00oLcNVYL2Rp-IXpuZ61tugQ%40sfdc.net.

Luis Pandolfi

unread,
Apr 23, 2021, 9:55:13 AM4/23/21
to AdWords API and Google Ads API Forum
Thank you! you saved my day.

Luis Pandolfi

unread,
Apr 23, 2021, 12:07:09 PM4/23/21
to AdWords API and Google Ads API Forum
Hi, just another question related to getting totals.

How can I get column totals? I mean, total like in a group by.

For example, I query at the adgroup level, and filter a subset of adgroup. I select campaign.name, and metrics.average_cost.
The result is aggregated at the adgroup level, one row per adgroup, so the result could have repeated campaigns. I want to get the total metrics.average_cost by campaign.

Is it possible with the API? I see Data Studio does it.

Best regards,
Luis

Google Ads API Forum Advisor Prod

unread,
Apr 23, 2021, 3:18:07 PM4/23/21
to luispa...@gmail.com, adwor...@googlegroups.com

Hi Luis,

Thank you for reaching out. The GAQL and the AWQL don’t support the group by functionality. As for your concern, it’s more appropriate to query the campaign resource rather than the ad_group resource. You could query the  metrics.average_cost from the campaign resource to obtain the average amount you pay per interaction on the campaign level. This amount is the total cost of your ads divided by the total number of interactions.



Thanks and regards,
Xiaoming, Google Ads API Team

 

Luis Pandolfi

unread,
Apr 23, 2021, 3:44:11 PM4/23/21
to AdWords API and Google Ads API Forum
Hi Xiaoming,

The issue in my case when querying the campaign level is that I cannot filter by fields of the ad_group resource.
I can achieve that using Data Studio, I guess Data Studio is not using neither GAQL nor AWQL then.
Is there any other way to do it?

Best regards,
Luis

Google Ads API Forum Advisor Prod

unread,
Apr 23, 2021, 4:08:59 PM4/23/21
to luispa...@gmail.com, adwor...@googlegroups.com

Hi Luis,

Thank you for reaching out. There is no other way to get the total metrics.average_cost by campaign when you query the ad_group resource, but if you need it on the ad_group level then you could directly query the metrics.average_cost.



Thanks and regards,
Xiaoming, Google Ads API Team

 

Luis Pandolfi

unread,
Apr 26, 2021, 4:01:02 PM4/26/21
to AdWords API and Google Ads API Forum
Hi Xiaoming,

I want the metric aggregated at the campaign level but filtering in the ad_group level.
I noticed that:
- If I query in the campaing level I cannot filter in the ad_group level, because ad_group is lower in the hierarchy.
- If I query in the ad_group level I can filter ad groups, but the metric is aggregated in the ad_group level and I cannot get total values for each campaign.

I want total values for each campaign and filter by some fields in the ad_group.
Is this an API restriction or can I do it in some way?

Best regards,
Luis

Google Ads API Forum Advisor Prod

unread,
Apr 26, 2021, 11:03:23 PM4/26/21
to luispa...@gmail.com, adwor...@googlegroups.com
Hi Luis,

Could you clarify what fields in the ad group resource that you want to filter and provide sample set of data that you want to get? I would suggest checking the campaign builder as it may help you construct your query report including the filters for ad group resource.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5001UAqWq9:ref

Luis Pandolfi

unread,
Apr 27, 2021, 10:00:53 AM4/27/21
to AdWords API and Google Ads API Forum
Hi Ernie,

Let me explain with the following scenario.

Lets say there are two campaigns with the following ad groups:

- Campaign 1
     - Ad group 1: nice ads
     - Ad group 2: really nice ads
     - Ad group 3: ugly ads
- Campaign 2
     - Ad group 4: some nice ads
     - Ad group 5: others ads

I want to get the average cost aggregated at the campaign level but only for the ad groups with the text "nice" in its name.
Notice I can do it in Data Studio.

The expected result is:
campaign.name, metrics.average_cost
Campaign 1, 456
Campaign 2, 789


Approach 1:

SELECT campaign.name, metrics.average_cost
FROM campaign
WHERE ad_group.name CONTAINS 'nice' AND segments.date DURING LAST_30_DAYS

This query result in an error, because I cannot filter by ad_group when querying campaign in the FROM.


Approach 2:

SELECT campagn.name, metrics.average_cost
FROM ad_group
WHERE ad_group.name CONTAINS 'nice' AND segments.date DURING LAST_30_DAYS

This query works, but is aggregated at the ad_group level, resulting in duplicates campaigns.
An example of this query result:
campaign.name, metrics.average_cost
Campaign 1, 367 <-- from Ad group 1
Campaign 1, 523 <-- from Ad group 2
Campaign 2, 789


How can I resolve that query?

Best regards,
Luis Pandolfi

Google Ads API Forum Advisor Prod

unread,
Apr 27, 2021, 2:32:33 PM4/27/21
to luispa...@gmail.com, adwor...@googlegroups.com
Hi Luis,

Unfortunately, it won't be possible to replicate the behavior you are looking for through the API. You will need to use the query from Approach 2 to get details on both your campaign and ad groups.

Regards,
Anthony

Google Logo
Anthony Madrigal
Google Ads API Team
 


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