Google Ads: remove location targets
remove_geo_targetsTakes location targets back out of a campaign.
The inverse of set_geo_targets. location_ids are targeted locations to
stop targeting; excluded_location_ids are exclusions to lift, so the
campaign can show there again; radius_criterion_ids are radius targets
to remove, by their criterion ID. Only the campaign's location and
radius targets are looked at: its languages, devices, ad schedule,
keywords and every other setting are never changed. A location the
campaign does not have is reported in not_found and nothing is done for
it; when none is found, nothing is sent. A Video campaign is refused
before anything is sent: the Google Ads API cannot change Video
campaigns, so its locations are changed in Google Ads.
A campaign with no targeted location or radius serves in every
location. Removing the last one is therefore refused unless
serve_everywhere is True. To move a campaign from one place to another,
add the new place with set_geo_targets first, then remove the old one.
Read the campaign's location targets with search: resource
campaign_criterion, fields campaign_criterion.criterion_id,
campaign_criterion.type, campaign_criterion.negative,
campaign_criterion.location.geo_target_constant,
campaign_criterion.proximity.radius,
campaign_criterion.proximity.radius_units,
campaign_criterion.proximity.address.city_name, conditions campaign.id =
<campaign_id>, campaign_criterion.type IN ('LOCATION', 'PROXIMITY'),
campaign_criterion.status != 'REMOVED'.
Args:
customer_id: The Google Ads customer ID (numbers only, no hyphens).
campaign_id: The ID of the campaign (digits only).
location_ids: Geo target constant IDs the campaign targets, to stop
targeting. Optional.
excluded_location_ids: Geo target constant IDs the campaign
excludes, to stop excluding. Optional.
radius_criterion_ids: Criterion IDs of radius targets to remove:
campaign_criterion.criterion_id from the read above, or the
number after "~" in the resource name set_geo_targets returned.
Optional.
serve_everywhere: True when the user has agreed that the campaign
may show in every location once its last targeted location or
radius is removed. Default: False.
Returns:
Dictionary with removed (kind, id and resource_name of each location
target taken out), not_found (each one the campaign did not have),
locations_removed and targeted_remaining (targeted locations and
radius targets left; 0 means every location).Tools revision: d80f65c0.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"customer_id": "<customer_id>",
"campaign_id": "<campaign_id>"
},
"name": "remove_geo_targets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| campaign_id | Yes | ||
| customer_id | Yes | ||
| location_ids | No | ||
| serve_everywhere | No | ||
| radius_criterion_ids | No | ||
| excluded_location_ids | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |