SCALIX help

← All tools

gads_remove_demographic_targeting

Google Ads write medium risk

Part of the Google Ads Audience Agent.

What it does

Remove previously-set demographic targeting/exclusion criteria (age/gender/parental status/income) from a campaign by their campaign_criterion resource_names (or by the demographic enums the tool resolves to resource_names via a lookup). Issues remove operations. Returns the removed resource_names and a readable confirmation. Preview->approve->commit: resolves targets, validate_only=true diff (campaign + each criterion removed, as removing: dimension, value, excluded or not), explicit approval, then commit (with preview_id) sends validate_only=false server-side + audit log; the commit is atomic. Accuracy: removing an EXCLUSION re-opens that audience, and the preview warns for each one; what removing a targeted value does depends on that dimension's targeting setting (bid_only), so the preview doesn't guess it. A descriptor that matches no criterion is not_found, several is ambiguous_criterion. 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 undo a demographic include/exclude (e.g. 'stop excluding 18-24'). Show in the preview exactly which criteria are removed; removing an age/income exclusion can re-open a restricted audience (the preview warns), so confirm before commit.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID, dashes/spaces stripped. Tenant context server-derived.
campaign_idstringyesNumeric campaign ID (used to resolve enums->resource_names and to scope the audit).
criterion_resource_namesarray<string>noFull campaign_criterion resource_names to remove (customers/{cid}/campaignCriteria/{campaign_id}~{criterion_id}). Preferred. Discover via gads_list_campaign_criteria.
demographicsarray<object>noAlternative: list of {dimension (AGE_RANGE|GENDER|PARENTAL_STATUS|INCOME_RANGE), value (enum), negative}. The tool looks up the matching criterion and resolves its resource_name before removal. Must match exactly one existing (non-removed) criterion: none is not_found, several is ambiguous_criterion.
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

Removing demographic exclusions can re-expose a campaign to audiences an advertiser intentionally restricted (e.g. age-gated/restricted verticals) — confirm the removal does not re-enable serving to a protected or restricted-from audience before committing.

Reminder

Demographic criteria are sensitive; confirm exactly which are removed and don't retain the data beyond this request.

Errors

Error classMeansWhat to doRetry
CUSTOMER_NOT_FOUNDCustomer ID not found or not linked.Verify CID (dashes stripped); re-auth if stale.no
TOKEN_REVOKEDAuthorization revoked / refresh token expired.Trigger re-auth (needs_reauth); do not retry with the dead token.no
CRITERION_NOT_FOUNDA target criterion resource_name does not exist or was already removed (Google refuses it at preview), or a demographics descriptor matched none (error_class not_found).Re-list via gads_list_campaign_criteria; surface which ones are stale. Nothing was removed: say so.no
AMBIGUOUS_CRITERIONA demographics descriptor matched more than one criterion (error_class ambiguous_criterion).Ask the user to supply the exact resource_name instead; do not guess which to remove.no
INVALID_ARGUMENTOperation rejected by the API (e.g. malformed resource_name).Surface platform message; fix input.no
PERMISSION_DENIEDMissing scope or read-only role.Report missing scope / role; do not retry.no
MANAGER_ACCOUNT_WRITETarget CID is a manager (MCC) account.Ask which child serving account to target.no
RESOURCE_EXHAUSTEDRate/quota limit (HTTP 429).Backoff 5->10->20s cap 60s, honor retryDelay; retry.yes
PLATFORM_UNAVAILABLEGoogle Ads 5xx / INTERNAL / DEADLINE_EXCEEDED.Idempotent retry with backoff.yes

Edge cases

  • Neither resource_names nor demographics supplied -> success:false 'nothing to remove'.
  • A criterion already removed -> a descriptor no longer matches it (not_found), and Google refuses its resource_name at preview.
  • Removing a targeted value changes reach only where the targeting setting restricts that dimension (bid_only=false); the preview names the criterion, it doesn't predict the reach.
  • Removing an exclusion in a restricted vertical may re-expose a protected audience -> the preview warns for each lifted exclusion.
  • Demographics descriptor matches multiple criteria -> ambiguous_criterion, require explicit resource_name; matches none -> not_found (nothing to remove).
  • Expired token -> refresh once, retry.
  • Preview expired before approval -> re-run validate_only before commit.