API Support Needed: Accessing "Target locations nearby" Functionality

55 views
Skip to first unread message

Amit Tomar

unread,
Nov 7, 2024, 11:10:48 PM11/7/24
to Google Ads API and AdWords API Forum
Hello Team,

I'm working with the Google Ads API V18 and need assistance with implementing the "Target locations nearby" functionality that exists in the Google Ads UI.

Currently, I can successfully use the GeoTargetConstantService to search for locations:
client = GoogleAdsClient.load_from_env(version="v18")
gtc_service = client.get_service("GeoTargetConstantService")
gtc_request = client.get_type("SuggestGeoTargetConstantsRequest")
gtc_request.country_code = "IN"
gtc_request.location_names.names.extend(['Delhi'])
results = gtc_service.suggest_geo_target_constants(gtc_request)

However, I cannot find an API endpoint that provides the same functionality as the "Target locations nearby" feature in the UI. For example, when searching for Delhi in the dashboard, it suggests nearby locations like Uttar Pradesh, Rajasthan, and Haryana with their respective reach numbers.
I have also thoroughly reviewed the GeoTargetConstants API documentation, but there is no mention of any endpoint or parameter for retrieving nearby locations.

I've attached screenshots showing this UI feature in action. Could you please:
1. Confirm if there's an API endpoint for this nearby locations functionality
2. If available, provide documentation or examples for implementing this feature
3. If not available through direct API, suggest alternative approaches to achieve similar results


Thank you for your assistance.
Screenshot from 2024-11-08 08-58-55.pngScreenshot from 2024-11-08 08-59-07.png

Amit Tomar

unread,
Nov 12, 2024, 2:04:46 AM11/12/24
to Google Ads API and AdWords API Forum
Hi Team, 

I’m following up on my query. Could you kindly provide an update on the status of my query? I would appreciate any information you can share.
Thank you for your assistance.

Google Ads API Forum Advisor

unread,
Nov 12, 2024, 7:08:01 AM11/12/24
to amittomar...@gmail.com, adwor...@googlegroups.com
Hi,

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

I would suggest you check this location targeting document to how you can use the Google Ads API to add, retrieve, and update location targeting for your campaigns. There are instances when targeting a specific area requires even more precision than focusing on a city or country. For instance, you might aim to promote your supermarkets within a 10-kilometer radius of your store location. In that case you can use the proximity targeting. You may refer this sample code to target campaigns for proximity to a location. 

You can use the location_view to retrieve most of the same information that the Locations report in the UI displays. If you query the location view, use the resource_name to retrieve the criterion ID (it's the last segment of the ID) and you can then use that ID to query the campaign_criterion resource to get even more information.

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.Search or GoogleAdsService.SearchStream.

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

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages