Getting the ACTUAL names for GEO TARGET CONSTANTS across POSTAL CODES, CITY, METRO

193 views
Skip to first unread message

Neelanjan Ghosh

unread,
Dec 19, 2024, 9:29:30 PM12/19/24
to Google Ads API and AdWords API Forum
Hi Team, 

While fetching geo_target_metro, geo_target_city and segments.geo_target_postal_code from the geographic_view resource, the API returns encoded values with some kind of IDs. like - "geoTargetConstants/200561, geoTargetConstants/1015239...etc."

How can I get the ACTUAL VALUES of the CITY NAME, POSTAL CODE, and METRO REGION NAME ? 

Query
SELECT customer.id,campaign.id,campaign.name,segments.geo_target_metro,segments.geo_target_city,segments.geo_target_postal_code,segments.date,metrics.clicks, metrics.impressions, ad_group.id, ad_group.type FROM geographic_view
WHERE customer.id = '{customer_id}'

Google Ads API Forum Advisor

unread,
Dec 19, 2024, 11:25:31 PM12/19/24
to neelanja...@gmail.com, adwor...@googlegroups.com
Hi,

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

I understand that you are looking for guidance on how to retrieve the actual names for geo target constants across the postal codes, city and metro. I would recommend you to use the geo_target_constant resource to retrieve the actual names for the geo target constants using the Google Ads API. However, I am providing the sample GAQL query on how to fetch the location by its resource name:
SELECT geo_target_constant.canonical_name,
  geo_target_constant.country_code,
  geo_target_constant.id,
  geo_target_constant.name,
  geo_target_constant.status,
  geo_target_constant.target_type
FROM geo_target_constant
WHERE geo_target_constant.resource_name = 'geoTargetConstants/{criterionId}'
I would recommend you to refer to the 'Looking up geo constants' guide for more information. Additionally, you can utilize the Google Ads Query Builder and Query Validator to build and validate the queries for retrieving the data from the Google Ads API.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGpuH:ref" (ADR-00279377)

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5


 


Reply all
Reply to author
Forward
0 new messages