Country criterion id

92 views
Skip to first unread message

Sara Khatib

unread,
Oct 8, 2024, 9:24:51 AM10/8/24
to Google Ads API and AdWords API Forum
Hey everyone, I have this field geographic_view.country_criterion_id  and I want to parse the id to actual country name, how can I do that? 

Google Ads API Forum Advisor

unread,
Oct 8, 2024, 10:43:59 AM10/8/24
to khati...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

You need to use the geo_target_constant resource to retrieve the country name, code and canonicalName. In the where condition you need to filter with the previously obtained country criterion ID. 
SELECT geo_target_constant.id, geo_target_constant.canonical_name, 
geo_target_constant.name, geo_target_constant.resource_name, 
geo_target_constant.country_code 
FROM geo_target_constant 
WHERE geo_target_constant.id = 'xxxx'
You may check the sample code to look up the criterion ID by location name. Additionally, you can utilize the Query Builder and Query Validator to build and validate your queries. To retrieve Google Ads API entities and reporting data, you can use one of these rest interface methods like GoogleAdsService.SearchStream or GoogleAdsService.Search.

I hope this helps! Let us know if you have any further questions. 
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGcnS:ref" (ADR-00270980)

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages