Set campaign locations, excluded devices, and ad schedule
set_campaign_targetingAdd positive location targeting, device exclusions, and/or an ad schedule (day-parting) to a campaign. A campaign with no location criteria at all defaults to Google's broadest reach, not 'no targeting' - set this before enabling any campaign meant for specific markets. Device exclusion is a 0 bid modifier on that device's campaign criterion, not a negative criterion - Google Ads has no true negative/exclude on a DEVICE criterion (confirmed live: the API rejects negative: true on one as an immutable field), so a 0 modifier is the real mechanism the Ads UI itself uses for 'excluding' a device on a Search campaign. Google auto-creates one MOBILE/TABLET/DESKTOP criterion per campaign at creation time, so excluding one of those updates its existing criterion; a device with none yet (e.g. CONNECTED_TV) gets one created at modifier 0.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adSchedule | No | Day-parting: one entry per day+hour-range block to serve in, e.g. Mon-Fri 9-18 is 5 entries. A campaign with no ad schedule at all serves every hour of every day. | |
| campaignId | Yes | ||
| customerId | No | 10-digit Google Ads customer id. Omit only if this connection has exactly one reachable account - with more than one, omitting it errors and lists the available ids to pick from. | |
| extraFields | No | Escape hatch for a field Google requires that this tool doesn't set yet - use it when a prior call to this same tool failed naming a required field and its valid values (e.g. after adding `contains_eu_political_advertising`, retry with { contains_eu_political_advertising: "DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING" }). Keys are the Ads API's own snake_case field names; nest an object to add a field under one this tool already sets (e.g. a new network_settings sub-field). Only ADDS fields not already set by this tool's own arguments - it can never override `status` or any other field already set here, so it cannot be used to bypass validation or a safety default like a campaign's PAUSED-by-default status. | |
| geoTargetIds | No | Geo target constant ids to target, e.g. ['2840','2372'] for US and Ireland. Additive - existing location criteria are left alone. | |
| validateOnly | No | Dry run. When true the Google Ads API validates the change and reports any errors but applies nothing. Use this first whenever you are unsure - it is free and cannot affect spend. | |
| excludeDevices | No | Device types to exclude from serving, e.g. ['MOBILE']. Implemented as a 0 bid modifier - Google Ads has no true device exclusion - which in practice stops that device from serving. |