gads_search_geo_locations
Google Ads read low risk
Part of the Geo Targeting Agent.
What it does
Resolve place names (or geo target constant resource names) into Google Ads geo target constant criterion IDs for use in location/proximity targeting. Wraps GeoTargetConstantService.SuggestGeoTargetConstants: given location names plus a locale and country_code, returns candidate matches with criterion ID, canonical name, target type (Country/Region/City/Postal Code/DMA), country code, status (ENABLED/REMOVAL_PLANNED), and reach where available. Read-only helper that makes gads_add_location_targeting safe (never guess a numeric ID). Accuracy: returns the exact criterion IDs Google recognizes; if a name is ambiguous it returns ALL candidates ranked — the caller/user picks, the tool never auto-selects. Returns success+count:0 when no location matches.
When to use it
When you need to turn place NAMES into geo criterion IDs before location targeting (names-to-IDs lookup; for performance by location use gads_get_geo_performance).
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
location_names | array<string> | yes | Free-text place names to resolve (e.g. ['New York', 'California', '90210']). Trim whitespace; do not pre-encode. |
locale | string | no | ISO 639-1 language for the returned canonical names (e.g. 'en'). Defaults to 'en' if invalid/omitted. |
country_code | string | no | ISO 3166-1 alpha-2 country to scope the search (e.g. 'US'). Strongly recommended to disambiguate (many cities share names). |
Safeguards
Policy
Geo lookup is read-only reference data; do not present resolved locations as performance data and do not use it to enable restricted-vertical serving in regions where the vertical is prohibited.
Reminder
Return only what Google's geo service exposes; don't infer locations it didn't return and don't retain beyond this request.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
INVALID_ARGUMENT | Empty location_names or malformed locale/country_code. | Surface the platform message; supply at least one name and a valid 2-letter country code. | no |
TOKEN_REVOKED | Authorization revoked / refresh token expired. | Trigger re-auth (needs_reauth); do not retry with the dead token. | no |
PERMISSION_DENIED | Bearer token lacks the adwords scope. | Report missing scope; do not retry. | no |
RESOURCE_EXHAUSTED | Rate/quota limit (HTTP 429). | Backoff 5->10->20s cap 60s, honor retryDelay; retry. | yes |
PLATFORM_UNAVAILABLE | Google Ads 5xx / INTERNAL / DEADLINE_EXCEEDED. | Idempotent retry with backoff. | yes |
Edge cases
- No match for a name -> that name returns zero candidates; overall success:true with count of what matched, plus a note on unmatched names.
- Ambiguous name (e.g. 'Springfield', 'Paris') -> multiple candidates returned; do NOT auto-pick — surface all for user choice.
- Status REMOVAL_PLANNED -> flag that the geo constant is being retired; prefer an alternative.
- Postal codes need country_code scoping or they resolve poorly -> recommend supplying it.
- Locale invalid -> Google defaults to 'en'; note the fallback.
- Expired token -> refresh once, retry.