How to retrieve underlying Google Ads API query from existing report?

807 views
Skip to first unread message

Piotr Tybulewicz

unread,
Sep 21, 2021, 7:29:35 AM9/21/21
to AdWords API and Google Ads API Forum

Hi

Let’s say that I’ve used Google Ads UI (ads.google.com) to modify a bit a Campaign report that is available in Reports -> Predefined (Dimensions) -> Basic section. When I’m satisfied with the report layout, I would like to get the underlying GAQL query so I could use it to call the Google Ads API by mysefl. Is that query visible somewhere?

Thanks in advance,

Piotr

Google Ads API Forum Advisor

unread,
Sep 21, 2021, 11:08:25 PM9/21/21
to piotr.ty...@newellco.com, adwor...@googlegroups.com
Hi Piotr,

Thank you for posting your concern.

I am afraid that this is not possible as API could not access the query and data in predefined reports made in the UI. You will need to construct the GAQL manually based on the fields you've used in the Reports -> Predefined (Dimensions) -> Basic section. The Google Ads Query Builder could help you to build your query.

Let me know if you have further questions.

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


ref:_00D1U1174p._5004Q2OSiEm:ref

Newell DTC

unread,
Sep 22, 2021, 1:54:02 AM9/22/21
to AdWords API and Google Ads API Forum
Hi Ernie

Thanks for your response.

And how about the query for predefined reports without any customizations/changes? Is it available? I'm aware of this page (https://developers.google.com/google-ads/api/docs/query/cookbook#campaigns) but that query doesn't contain all fields from predefined Campaign report.

And another question: UI uses user-friendly names of various fields and metrics while API doesn't. Sometimes it is obvious how to map one field to another but sometimes it isn't, e.g. Targeting -> Network (with search partners). Is there any mapping available that translates UI field to API field?

Piotr

Google Ads API Forum Advisor

unread,
Sep 22, 2021, 2:49:35 PM9/22/21
to newel...@lingaro.io, adwor...@googlegroups.com
Hello,

While it is not fully comprehensive, I would recommend looking over the guide, Reports in the UI. In addition to other information, it provides the resources that map to several predefined reports in the UI. Most attributes and metrics in API reports are named similarly to their UI names. For your ad network example, you can use the AdNetworkType segment. If you have any specific questions, please let us know. 

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2OSiEm:ref

Newell DTC

unread,
Sep 23, 2021, 8:08:21 AM9/23/21
to AdWords API and Google Ads API Forum
Hi Matt

Thank you for your answer. Would you be so kind and also provide API mappings for the following UI fields at Campaign level:
1. Performance -> Watch time.
2. Viewability -> Non-viewable impr.
3. Viewability -> Non-measurable impr.
4. Viewability -> Non-viewable impr. distrib.
5. Viewability -> Non-measurable impr. distrib.
6. Viewability -> Viewable CTR.
7. Viewability -> Viewable impr. distrib.
8. Conversions -> Orders.
9. Conversions -> Revenue.
10. Attributes -> Campaign group.
11. Attributes -> Campaign subtype.

They can be accessed from UI in this way:
1. Select some Google Ads account.
2. Expand Campaigns and click on Campaigns button.
3. Click on Columns button between the graph and the table.

Thanks in advance.

Piotr

Google Ads API Forum Advisor

unread,
Sep 26, 2021, 9:54:54 PM9/26/21
to newel...@lingaro.io, adwor...@googlegroups.com
Hi Piotr,

It appears that the fields you've mentioned currently don't have equivalent fields in the Google Ads API. With this, so that I can raise a feature request to my team for these fields, could you provide a sample use case why you need these fields? Also, could you clarify on what type of campaign you want to retrieve this information?

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


ref:_00D1U1174p._5004Q2OSiEm:ref

Newell DTC

unread,
Sep 27, 2021, 9:33:23 AM9/27/21
to AdWords API and Google Ads API Forum
Hi Ernie

Thanks for the response. My use case is that business users defined a list of metrics they would like to be ingested into a data warehouse (based on what is visible in UI) and I wanted to use the Google Ads API to query for them. As for campaign types - basically Search and Video ones.

Could you also please check one more metric if it is available in the API?
1. Reach metrics -> Unique users.

Piotr

Google Ads API Forum Advisor

unread,
Sep 28, 2021, 11:07:09 PM9/28/21
to newel...@lingaro.io, adwor...@googlegroups.com
Hi Piotr,

Thank you for your follow up. I'm also from the Google Ads API support team and allow me to assist you as well.

For campaign (search, videos, and others) level reporting, you can refer to the campaign report for all the available attributes, metrics and segments fields that you can extract using the Google Ads API. I also recommend that you user our Query builder and Query validator to help in constructing the queries before using them in your API requests.

Also, if my understanding is correct that you wish to map the fields from an existing (downloaded from UI) report to the API's fields, then this is not possible via an API request. You will have to map them manually and use the documentation I mentioned above to construct the queries.

As for unique users, this is currently not supported. However, our team has already previously created a feature request, subject for review, regarding its availability in the API. For now, you may keep an eye on our blog for updates or announcements.

Furthermore, for the list of fields that you sent over (ex. Performance -> Watch time), could you also provide the complete screenshot of the UI where all the said fields are visible? This is so that our team can create the feature request for the said fields.

Lastly, if the screenshot would contain your user / account information, you may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


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