How can i get the targeted locations for an campaign like the settings page

688 views
Skip to first unread message

Mohammad si abbou

unread,
Dec 1, 2022, 6:06:54 AM12/1/22
to Google Ads API and AdWords API Forum
I'm using the geo_target_constant to fetch the targeted locations for a campaign and it's working, but the results are not the way I want them to be,  for example, if I target a country it shows all the Provinces and cities... instead of getting the country.
I want it to show results like the one in the picture (from the campaign settings page)

I will appreciate any help
Screenshot 2022-12-01 at 11-59-06 Settings - ads-account - Google Ads.png

Google Ads API Forum Advisor

unread,
Dec 1, 2022, 10:16:28 AM12/1/22
to mohammadsia...@gmail.com, adwor...@googlegroups.com
Hi Mohammad,

Thanks for reaching out. Are you using geo_target_constant.canonical_name to retrieve this information? This attribute should return the country name. For proximities, the country code can be retrieved with campaign_criterion.proximity.address.country_code. 

Regards,

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2ghOJY:ref
Message has been deleted

Mohammad si abbou

unread,
Dec 7, 2022, 4:53:19 AM12/7/22
to Google Ads API and AdWords API Forum
yes, I'm using geo_target_constant.canonical_name, I think the problem is from my query can you help me with that ? , here is the query :

SELECT geo_target_constant.target_type, geo_target_constant.status, geo_target_constant.parent_geo_target, geo_target_constant.parent_geo_target, geo_target_constant.name,
geo_target_constant.id, geo_target_constant.country_code, geo_target_constant.canonical_name
FROM geo_target_constant
WHERE geo_target_constant.parent_geo_target IN ('
geoTargetConstants/2634', 'geoTargetConstants/2636');

I need to get geo_target_constant based on the campaign id, this was a walk around if you could help me with a new query that uses the campaign id to retrieve the geo-target data I will appreciate it.

Google Ads API Forum Advisor

unread,
Dec 7, 2022, 10:11:22 AM12/7/22
to mohammadsia...@gmail.com, adwor...@googlegroups.com
Hi Mohammad,

Thank you for your response and for the additional details.

In the Google Ads API, and in the targeted locations context, you can try and use the location_view instead since this report returns statistics of your campaign Location criteria.

Let us know if this is what you're looking for.

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


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