Difference between Reporting and Querying in Google Ads API

965 views
Skip to first unread message

Vinutha Nayak

unread,
May 31, 2019, 12:38:33 AM5/31/19
to AdWords API and Google Ads API Forum
Hi All,

1. I am totally confused with respect to Querying and Reporting sections of the Google Ads API. Both use select clause and are in the form of Query. 
Can anyone explain the difference please ?


2. I was reading the "keyword_view"  in the reporting section. I don't exactly know how and when should we use keyword_view  in the FROM  clause.  Is it something we can't 
achieve through the regular querying way ? Can anyone please let me know the exact use of the keyword_view.  I put some fields in SELECT clause like 
"ad_group_ad.ad.idand "campaign_criterion.proximity.radius". 

Then I get the following errors like :
 "Cannot select fields from the following resource: 'CAMPAIGN_CRITERION', since the resource is incompatible with the resource in FROM clause."   
                      and
  Error with message "Error in query: unexpected input keyword_view.".

Can anyone please explain why it happens ? 


Thanks and Regards,
Vinutha  Nayak

Google Ads API Forum Advisor Prod

unread,
May 31, 2019, 4:38:11 AM5/31/19
to adwor...@googlegroups.com
Hi Vinutha,

You may refer below for my answers to your questions :

1. The querying section discusses the different ways you can retrieve information using the Google Ads API. The language used for resource query and metrics query is similar. The difference, as discussed in this section, is that in metrics query, you choose to retrieve performance data along with the resource data.

As for the reporting section, it discusses more in detail how you can retrieve performance data.

2. In the report fields, the documentation includes all the metrics and segments that can be included in your query for that specific resource. However, not all the fields listed there are compatible with each other. You will have to access the documentation per metric/segment field to confirm their compatibility.

In the Keyword View, you can see all the available fields that you can select from the Metrics and Segments dropdowns. To determine a field's compatibility, you can click on the said field (for example, metrics.average_cost) then you can check the Selectable with dropdown to see which other metrics and segments you can select that field with.

Thanks and regards,
Peter
Google Ads API Team

ref:_00D1U1174p._5001UBfrfY:ref

Vinutha Nayak

unread,
May 31, 2019, 4:56:07 AM5/31/19
to AdWords API and Google Ads API Forum
Hi Peter,

Thanks for getting back !

Sorry, I am still not fully clear on the same. 

1. You mention "As for the reporting section,it discusses more in detail how you can retrieve performance data."  I didn't quite get that. What are the extra details that we can achieve through reporting and not through querying ? Can you please provide an example to clarify that ?

2.  Can you please explain in simple terms "What is exactly keyword_view?" , a simple example perhaps that can explain what can be achieved only through keyword_view and not by running simply query ?

'SELECT campaign.id, campaign.name, ad_group.id, ad_group.name, '
             
'ad_group_criterion.criterion_id, '
             
'ad_group_criterion.keyword.text, '
             
'ad_group_criterion.keyword.match_type, '
             
'metrics.impressions, metrics.clicks, metrics.cost_micros '
             
'FROM keyword_view WHERE segments.date DURING LAST_7_DAYS '
             
'AND campaign.advertising_channel_type = \'SEARCH\' '
             
'AND ad_group.status = \'ENABLED\' '
             
'AND ad_group_criterion.status IN (\'ENABLED\', \'PAUSED\') '
             
'ORDER BY metrics.impressions DESC '
             
'LIMIT 50'

For example in the above documentation, can we write two queries :
1.  selecting campaign.name and id and metrics from campaign
2.  ad_group related things from ad_group 

Is keyword_view used when we have to extract all the information in one go ?  Sorry but I need to understand when specifically keyword_view is used. 

As I said, if I add campaign_criterion or ad_group_ad.ad.id  to the "Select" clause it fails with exception given. Hence if I need to extract specific details provided for a campaign_criterion like .. for an Ad what was the radius it covered, ( which needs to be extracted from campaign_criterion) is it possible at all  ?


Thanks and Regards,
Vinutha Nayak


Google Ads API Forum Advisor Prod

unread,
May 31, 2019, 5:59:58 AM5/31/19
to adwor...@googlegroups.com
Hi Vinutha,

1. Reporting is basically a form of querying. In reporting, you use the query language to retrieve both resource and performance data. As I discussed earlier, there are two types of querying, resource and metrics querying. Reporting utilizes both as you query resource and the performance data generated or associated to that resource.

2. Keyword view can best be explained as the equivalent of the Keywords Performance Report of the AdWords API. You can, through this view, retrieve information specific to your keywords and their statistics. Now, not every field can be included in you query, not all 'views' can be put together in a single report request.

In order to determine which fields are compatible or can be included for the 'view', you should take note of the Selectable With, Attribute Resources, Metrics and Segments dropdowns. In these dropdowns, you would then need to further check which of these can be included in the select query as some fields are incompatible with others. You will need to further validate by clicking the field, ex. metrics.average_cost (which should redirect you to the documentation for that field) and viewing another Selectable With dropdown.

Best regards,
Reply all
Reply to author
Forward
0 new messages