gads_create_data_exclusion
Google Ads write medium risk
Part of the Seasonality Agent.
What it does
Tell Smart Bidding to IGNORE the conversion data of a period whose tracking was broken (a site outage, a tag that stopped firing, a checkout fault), so it does not lower bids on the false drop or raise them on a false spike: a data exclusion (BiddingDataExclusionService). Window: start_date_time to an EXCLUSIVE end_date_time, 'yyyy-MM-dd HH:mm:ss' in the account's time zone, at most 14 days. Covers either named campaigns (campaign_ids, the only way to cover Performance Max, Demand Gen or App) or whole channels (channel_types SEARCH, DISPLAY, SHOPPING); never the whole account (Google does not allow that through the API). Optional devices (MOBILE, TABLET, DESKTOP). Only Smart Bidding reacts (target CPA, target ROAS, maximize conversions, maximize conversion value); manual CPC and other strategies ignore it. Meant for days already affected: a window starting in the future (by the account's own clock) comes back with a warning pointing to gads_create_seasonality_adjustment. WRITE with preview->approve->commit: preview = mutate validate_only=true + the event's fields + preview_id; commit = the same call plus that preview_id after the user approves in a later message + audit. Returns the new resource_name. 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 conversion tracking or the site broke for a known period (an outage, a missing tag, a double-counting fault) and Smart Bidding should ignore those days' data: a data exclusion. For an expected future change in conversion rate (a sale, a launch), use gads_create_seasonality_adjustment.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID, dashes stripped. Not a manager (MCC) account: Google refuses these there. |
name | string | yes | Name shown in Google Ads (at most 255 characters; unique per account for seasonality adjustments). |
start_date_time | string | yes | Inclusive start, 'yyyy-MM-dd HH:mm:ss' in the account's time zone (e.g. '2026-11-27 00:00:00'). |
end_date_time | string | yes | EXCLUSIVE end, 'yyyy-MM-dd HH:mm:ss' in the account's time zone; at most 14 days after the start (e.g. a whole day of 27 Nov ends '2026-11-28 00:00:00'). |
scope | string | no | CAMPAIGN or CHANNEL; inferred from which list you give. CUSTOMER (whole account) cannot be created through the API and is refused. |
campaign_ids | array | no | Scope CAMPAIGN: the campaign ids it covers (1 to 2,000). The only way to cover Performance Max, Demand Gen or App campaigns. From gads_list_campaigns. |
channel_types | array | no | Scope CHANNEL: any of SEARCH, DISPLAY, SHOPPING (all campaigns of those types). Not together with campaign_ids. |
devices | array | no | Optional: any of MOBILE, TABLET, DESKTOP. Leave out for all devices. |
description | string | no | Optional note shown in Google Ads (at most 2,048 characters). |
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
Exclude only periods whose conversion data was genuinely wrong (tracking or site faults). Never use an exclusion to hide real poor performance or to game Smart Bidding toward a target; that misleads the advertiser's own bidding.
Reminder
Exclusions are for broken data, not bad results; keep the window to the affected days only, and confirm the exact start and end in the account's time zone.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
invalid_argument | A time is not 'yyyy-MM-dd HH:mm:ss', the end is not after the start, the window is over 14 days, scope CUSTOMER was asked for, both or neither of campaign_ids and channel_types were given, a channel is not SEARCH/DISPLAY/SHOPPING, or a device is not MOBILE/TABLET/DESKTOP. | Fix what the message names and preview again; nothing was sent to Google. | no |
RESOURCE_LIMIT | The account has too many active data exclusions (Google allows 500 data exclusions per account). | Remove old ones with gads_remove_data_exclusion first. | no |
google_ads_error | Google refused the event at preview (for example a campaign that is not in this account, or a field combination Google does not allow). | Fix what Google's message names and preview again. | no |
OPERATION_NOT_PERMITTED_FOR_CONTEXT | Google refuses these on a manager (MCC) account. | Run it on the client account the campaigns belong to. | no |
needs_reauth | Authorization expired or revoked. | Reconnect Google Ads in the Scalix dashboard. | no |
rate_limited | Google Ads rate limit hit. | Wait a minute, then call again. | yes |
Edge cases
- The end is exclusive: one whole day of 27 Nov is '2026-11-27 00:00:00' to '2026-11-28 00:00:00'.
- Google allows at most 14 days per exclusion; split a longer fault into several.
- Performance Max, Demand Gen and App campaigns cannot be covered by channel: name them with campaign_ids.
- Campaigns on manual CPC are unaffected even if covered.
- A future window comes back with a warning: exclusions are for days already affected.