gads_add_negative_placements
Google Ads write medium risk
Part of the Placement Agent.
What it does
Bulk-add website placement exclusions (placement.url) as NEGATIVE criteria at campaign or ad-group level, typically from a placement audit. Preview runs the mutate with validate_only=true and returns a plain-English diff (each placement plus its last-30-day spend, in micros and in the account currency, e.g. 123.46 INR) and a preview_id; re-calling with that preview_id after the user approves executes it (atomic: all placements or none) and writes the audit log. Mirrors the negative-keyword flow; defaults to campaign level unless an ad group is specified. 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 exclude junk/wasted placements (typically from a placement audit) - present the list plus spend, get explicit approval, then commit; default to campaign level unless ad-group is specified.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit account, dashes stripped. |
level | string | yes | campaign | ad_group - where the exclusion is applied. |
parent_id | string | yes | campaign_id (level=campaign) or ad_group_id (level=ad_group). |
placements | array | yes | List of website placement URLs to exclude as negatives (e.g. example.com or example.com/section); one negative criterion is created per URL. Website placements only. |
manager_id | string | no | login-customer-id when reached via an MCC. |
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
Approval mandatory (preview->approve->commit). Show each placement with its recent spend before applying; over-exclusion permanently removes reach, so present the full list and apply ONLY what the user approved. Audit/placement data is not retained beyond the request.
Reminder
Show the placement list with spend, preview->approve->commit, apply only the approved exclusions.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
INVALID_ARGUMENT | A placement URL/type is malformed or not a valid criterion (CriterionError). Surface the exact platform message and the offending placement. | Fix the placement value/type and re-preview; do not guess. | no |
DUPLICATE_CRITERION | One or more placements are already excluded at this level. | Skip duplicates and report which were already present; commit the rest. | no |
RESOURCE_EXHAUSTED | Daily ops/QPS quota exceeded (HTTP 429). | Exponential backoff 5/10/20s (cap 60s) honoring retryDelay, then retry; batch (max 10,000 ops/request). | yes |
TOKEN_REVOKED | OAuth token expired/revoked (UNAUTHENTICATED). | Refresh once and retry; else prompt re-auth (needs_reauth). | yes |
PERMISSION_DENIED | User lacks access to this account/criterion (USER_PERMISSION_DENIED). | Confirm access; do not retry on another account. | no |
PARTIAL_FAILURE | Some placements failed while others succeeded (partial_failure). | Return {results, failures:[{index,error}]}; report which placements were excluded and which failed and why. | no |
Edge cases
- Empty placements list -> invalid_argument; nothing is sent.
- Placement already excluded: the tool does not check; Google's preview answer is returned.
- Bulk over 10,000 ops -> split into batches.
- Preview (Redis TTL) expired -> re-preview before commit.
- Over-exclusion warning: excluding high-spend placements removes reach - surfaced in the diff.
- Website placements only: mobile apps and YouTube channels or videos are other criterion types this tool does not create.