Queries without FROM clause

61 views
Skip to first unread message

Aliaksandr Sheliutsin

unread,
Feb 19, 2020, 9:29:40 AM2/19/20
to AdWords API and Google Ads API Forum
Hello

I need to download the next data from Google Ads API:
Information about clicks (metrics.clicks, metrics.cost_micros) with ad_group information (ad_group.campaign and ad_group.id), segmented by segments.device, segments.hour, segments.date and country.

I tried to find a table wich fulfill all the requirements. I looked through all tables in reports tab of your documentation (https://developers.google.com/google-ads/api/fields/v2/overview) "Resources with metric" section and, it seems like the ad_group table is the table I need, but it only works while I set "No" in "Is ad_group specified in the FROM clause of your query?"

I've read in Query Structure (https://developers.google.com/google-ads/api/docs/query/structure)  that the FROM clause is required in a query, however it should not be specified when using GoogleAdsFieldService. But GoogleAdsFieldService only can retrieve fields' metadata.

So the questions are:
1. Is there any other data except metadata I can retrieve without specifying the FROM clause in a query?
2. What options do I have to retrieve the data I need? (Combining table sources? Not optimal as I will not be able to segment the data by myself)

Thanks for the answers in advance.

Google Ads API Forum Advisor Prod

unread,
Feb 19, 2020, 2:51:29 PM2/19/20
to sheliutsin...@gmail.com, adwor...@googlegroups.com

Hi Aliaksandr,

Thank you for reaching out to us. I see two questions that need to be addressed.

1. Is there any other data except metadata I can retrieve without specifying the FROM clause in a query?

In ad_group reports, there are listed “Attributed resources” that work together with ad_group. So when the documentation specifies “if ad_group is specified in the FROM clause of your query”, it’s asking whether it’s ad_group being specified in the FROM clause, or campaign/customer. Therefore, you should be able to get this data by specifying that ad_group is not specified in your FROM clause, but specifying that campaign or customer is.

2. What options do I have to retrieve the data I need? (Combining table sources?)
You can choose to do the method you originally chose, or you’d have to combine different table sources.  

Let me know if you have further questions.

Thank you,
Bryan, Google Ads API Team



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