gads_add_proximity_targeting
Google Ads write medium risk
Part of the Geo Targeting Agent.
What it does
Add a proximity (radius) targeting criterion to a campaign: a center point (lat/lon or an address) plus a radius and unit (MILES|KILOMETERS), optionally with a bid_modifier. Creates a campaign_criterion with ProximityInfo {geo_point.longitude_in_micro_degrees, latitude_in_micro_degrees, radius, radius_units, optional address}. The preview shows the center in degrees, the radius in its unit and in km and miles, and a readable 'within X km (Y mi) of <point>' area; the commit returns the created resource_name. Preview->approve->commit: validate_only=true diff (campaign, center, radius+unit, modifier), explicit approval, commit (with preview_id) sends validate_only=false server-side + audit log; the commit is atomic. Accuracy/constraints: a campaign takes up to 500 radius targets besides its locations, and Google serves in all of them together (the preview counts the existing ones); lat/lon are sent as micro-degrees (degrees x 1e6, rounded integer), converted here; the radius is more than 0 and at most 800 km / 500 miles (refused before the API), and Google requires at least 1 km (a warning); bid_modifier is a multiplier (0.1-10.0), not micros. PREVIEW SEMANTICS: the first call (no preview_id) is sent to the Google Ads API in validation mode — field, enum, policy and permission errors surface AT PREVIEW, nothing is changed, and the response returns a preview_id. To apply, show the preview to the user, get their approval, and re-call with that preview_id and IDENTICAL arguments within 30 minutes; changed arguments or an expired token fail closed to a fresh preview. validate_only=true forces another preview; validate_only=false alone never commits.
When to use it
Use when the user wants to target a radius around a point/store (e.g. 'within 10 miles of our shop'). Confirm the center and radius in the preview. A campaign takes up to 500 proximity (radius) targets, and they add to its other location targeting (a union): the preview says when the campaign already has some.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID, dashes/spaces stripped. Tenant context server-derived. |
campaign_id | string | yes | Numeric campaign ID. |
latitude | number | no | Center latitude in decimal degrees; converted to latitude_in_micro_degrees (deg x 1_000_000, rounded integer). Required if address not supplied. |
longitude | number | no | Center longitude in decimal degrees; converted to longitude_in_micro_degrees. Required if address not supplied. |
address | object | no | Optional AddressInfo {street_address, city_name, province_name, postal_code, country_code} as an alternative to lat/lon. If both given, lat/lon defines the point and the address goes along as its label (v24 ProximityInfo: not validated, no effect on serving). |
radius | number | yes | Radius in radius_units: more than 0 and at most 800 km / 500 miles (Google Ads API system limits; refused before the API). Google Ads requires at least 1 km, and the preview warns below that. The preview shows it in km and miles. |
radius_units | string | yes | MILES or KILOMETERS (enum-normalized; another value is refused). Omitted: not sent, and Google uses KILOMETERS (v24 ProximityInfo). |
bid_modifier | number | no | Optional multiplier 0.1-10.0 (1.0 = none). Not micros. |
validate_only | boolean | no | Optional. true forces another preview even with a preview_id; false is DEPRECATED and no longer commits — only a valid preview_id applies the write. |
preview_id | string | no | Omit it to preview: nothing is applied, and the call returns a preview_id bound to this exact request. Pass it only after the user approves that preview in a later message, with the same arguments (leave out validate_only, and add any confirmation flag the preview names). Single-use, expires in 30 minutes; changed arguments need a fresh preview. |
Safeguards
A change in two steps. The first call previews and changes nothing; Claude shows you the preview and applies it only after you approve, within 30 minutes and with the same arguments. Every applied change goes to the audit log. How changes are approved.
Policy
Proximity targeting must not be used to evade restricted-vertical geo-gating or to re-serve a disapproved ad in a tight radius to dodge review (Circumventing Systems). Apply only the radius and center the user approved.
Reminder
Show the resolved center and radius in human units in the preview; don't retain location data beyond this request.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
CUSTOMER_NOT_FOUND | Customer ID not found or not linked. | Verify CID (dashes stripped); re-auth if stale. | no |
TOKEN_REVOKED | Authorization revoked / refresh token expired. | Trigger re-auth (needs_reauth); do not retry with the dead token. | no |
INVALID_GEO_POINT | Lat/lon out of range or address could not be geocoded. | Surface the bad coordinate/address; ask for a valid point. Do not guess coordinates. | no |
RADIUS_OUT_OF_RANGE | Radius above 800 km / 500 miles or not positive (Google: CriterionError.INVALID_PROXIMITY_RADIUS); refused before the API. | Surface the platform limit; ask user to reduce. Do not clamp silently. | no |
INVALID_ARGUMENT | Operation rejected (e.g. bad radius_units enum). | Surface exact platform message; fix input. | no |
OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE | Campaign type does not accept a proximity criterion or bid modifier (e.g. PMax/Smart). | Explain the channel-type limitation; branch before retry. | no |
PERMISSION_DENIED | Missing scope or read-only role. | Report missing scope / role; do not retry. | no |
MANAGER_ACCOUNT_WRITE | Target CID is a manager (MCC) account. | Ask which child serving account to target. | 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
- Neither lat/lon nor address supplied -> success:false 'center point required'.
- Up to 500 radius targets per campaign (Google Ads Help, account limits) -> a second radius is added next to the first, not refused.
- Decimal degrees are converted to micro-degrees (x1e6, rounded integer); the preview shows the degrees, the operation the micro-degrees.
- The preview shows the radius as sent, in its unit and in km and miles.
- Proximity coexists with location criteria; warn that overlapping geo targets UNION, not intersect.
- A radius under 1 km is below Google's minimum and may barely serve -> the preview warns.
- Expired token -> refresh once, retry.
- Preview expired before approval -> re-run validate_only before commit.