SCALIX help

← All tools

gads_add_negative_keywords

Google Ads write medium risk

Part of the Search Terms Agent.

What it does

Add negative keywords at campaign level (campaign_criterion) or ad-group level (ad_group_criterion). SCALIX SOP PRE-FLIGHT: (1) existing negatives at the same level and match type are skipped; (2) every proposed negative is cross-referenced against the POSITIVE keywords at that level — if it is a substring of, or >=0.8 similar to, a keyword you are bidding on, the call is BLOCKED with error_class 'keyword_conflict' naming each clash, and only proceeds when re-called with confirm_keyword_conflicts=true; (3) every BROAD negative emits a traffic-volume warning. PREVIEW->APPROVE->COMMIT. Returns {success, data:{applied:{created:[{text, match_type, level}], conflicts_flagged:[...], skipped_duplicates:[...], resource_names}}, warnings}. The preview shows a match-scope note for the match types used. 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 after reviewing gads_get_search_terms_report. Ask the match type per negative; prefer EXACT or PHRASE — a broad negative silently blocks every query containing the word.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID, dashes stripped.
levelstringyesCAMPAIGN or AD_GROUP (enum-normalized); determines campaign_criterion vs ad_group_criterion.
parent_idstringyescampaign_id when level=CAMPAIGN, else ad_group_id.
negativesarrayyesList of {text, match_type}. text trimmed, <=80 chars / 10 words; match_type EXACT/PHRASE/BROAD normalized. The negative flag is set server-side. Up to 10,000 ops.
confirm_keyword_conflictsbooleannoSet true to add negatives that clash with your positive keywords (blocked by default).
validate_onlybooleannoOptional. 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_idstringnoOmit 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

Negatives carry no content-policy risk, but over-broad negatives silently kill traffic — preview match scope. Do not use negatives to mask a disapproval instead of fixing it.

Reminder

Negative-keyword sources (search terms) may contain user PII — never log/retain the underlying queries.

Errors

Error classMeansWhat to doRetry
CUSTOMER_NOT_FOUNDAccount not found/linked.Verify CID/authorization.no
TOKEN_REVOKEDAuthorization expired/revoked.needs_reauth.no
INVALID_ARGUMENTInvalid negative (text >80 chars/10 words, bad match type) or unknown parent ID.Surface Google's message; correct input.no
MANAGER_ACCOUNT_NOT_SUPPORTEDCannot mutate criteria on a manager (MCC) account.Target a child serving account.no
PARTIAL_FAILURESome negatives rejected while others succeeded.Return per-op errors with index; succeeded committed.no
PERMISSION_DENIEDNo write access / out of bearer scope.Confirm role/scope.no
RESOURCE_EXHAUSTEDRate/quota limit (HTTP 429).Backoff 5/10/20s cap 60s; honor retryDelay.yes
TOO_MANY_MUTATE_OPERATIONSRequest exceeds the 10,000-operation mutate cap.Batch the negatives into chunks <=10,000.no
INTERNAL_ERRORTransient 5xx.Retry once after backoff.yes
account_inactiveThe Google Ads account is suspended or not enabled, so Google rejects every mutate - including validate_only=true previews. Reads keep working.Resolve the account status in the Google Ads UI (billing/policy). Do NOT tell the user to reconnect Google Ads; reconnecting cannot fix an account-state rejection.no

Edge cases

  • Empty negatives -> success count:0.
  • Duplicate negative at the same level -> Google returns a duplicate error; report which.
  • Broad negative may block far more than intended -> preview surfaces a scope warning.
  • Campaign-level vs ad-group-level overlap can double-block; note it.
  • validate_only clean still needs approval before commit.
  • Account-wide intent -> redirect to shared negative set tools.
  • Expired token -> refresh once and retry.