Able to create report in UI but not from API

52 views
Skip to first unread message

SDze

unread,
May 23, 2023, 8:56:50 AM5/23/23
to Google Ads API and AdWords API Forum
Hello, 

We are trying to fetch Campaign, Adgroup, SearchKeyword wise data and able to get the same in UI but unable to do the same in API. Attached the screenshot for the query we built in the UI. 
In the API, we tried multiple queries : 
  • SELECT customer.id, customer.currency_code, ad_group.id, ad_group.name, campaign.id, campaign.name, segments.keyword.info.text, metrics.clicks, metrics.cost_micros, metrics.conversions, metrics.engagements, metrics.impressions, metrics.view_through_conversions, metrics.search_impression_share, metrics.top_impression_percentage, metrics.absolute_top_impression_percentage FROM ad_group_ad
got below error :
  • 'metrics.search_impression_share' is not a valid field in the SELECT clause when 'ad_group_ad' is the resource in the FROM clause. Fields in the SELECT must be 'Selectable'.
With this :
  • SELECT customer.id, customer.currency_code, ad_group.id, ad_group.name, campaign.id, campaign.name, segments.keyword.info.text, metrics.clicks, metrics.cost_micros, metrics.conversions, metrics.engagements, metrics.impressions, metrics.view_through_conversions, metrics.search_impression_share, metrics.top_impression_percentage, metrics.absolute_top_impression_percentage FROM ad_group
Error : 
  • 'segments.keyword.info.text' is not a valid field in the SELECT clause when 'ad_group' is the resource in the FROM clause. Fields in the SELECT must be 'Selectable'.
Query :
  • SELECT customer.id, customer.currency_code, ad_group.id, ad_group.name, campaign.id, campaign.name, segments.keyword.info.text, metrics.clicks, metrics.cost_micros, metrics.conversions, metrics.engagements, metrics.impressions, metrics.view_through_conversions, metrics.search_impression_share, metrics.top_impression_percentage, metrics.absolute_top_impression_percentage FROM search_term_view
Error : 
  • 'metrics.search_impression_share' is not a valid field in the SELECT clause when 'search_term_view' is the resource in the FROM clause. Fields in the SELECT must be 'Selectable'.
So basically we've tried out multiple scenarios and multiple resources yet unable to get the exact data that I got from the API [As in Screenshot].
Can someone please help.

Screenshot 2023-05-23 at 6.21.20 PM.png
Screenshot 2023-05-23 at 6.19.23 PM.png

Google Ads API Forum Advisor

unread,
May 25, 2023, 5:12:42 AM5/25/23
to shubham...@tercept.com, adwor...@googlegroups.com

Hello,

Thank you for reaching out to Google Ads API Forum.

I see that you have tried queries from different reports but unable to get the exact data from the UI. It also appears that these queries contain invalid fields. Please note that when you specify a resource in the FROM clause, some metrics and segments cannot be used. With this, I would suggest that you refer to the following documentation for ad_group_ad, ad_group and search_term_view reports respectively. 

Additionally, you may utilize the query builder (https://developers.google.com/google-ads/api/fields/v13/overview_query_builder?hl=en) and query validator (https://developers.google.com/google-ads/api/fields/v13/query_validator?hl=en) for building and validating your query.

If you are still unable to get the data after referring to the above mentioned reports, kindly share with us the UI screenshot (without cropping) showing the CID and data you want to get using API. This is so we could provide more appropriate recommendations.

You can provide it via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

This message is in relation to case "ref:_00D1U1174p._5004Q2lsNSv:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages