SCALIX help

← All tools

gads_remove_ad

Google Ads write high risk

Part of the Google Ads Manager Agent.

What it does

Permanently remove an ad via AdGroupAdService.MutateAdGroupAds remove operation (ad_group_ad resource_name only; irreversible transition to REMOVED). The ad stops serving and cannot be restored — only a new ad can be created. PREVIEW->APPROVE->COMMIT: validate_only=true dry run -> plain-English warning that removal is permanent (vs pausing, which is reversible) -> explicit approval -> execute with partial_failure=true -> confirm resource name + UTC timestamp + audit log. Removal is destructive, so approval must be unambiguous. 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 only when the user explicitly wants to permanently delete an ad. Prefer gads_pause_ad if they might want it back. Always preview with validate_only and require unambiguous approval before committing.

Inputs

NameTypeRequiredDescription
ad_idstringyesNumeric ad id.
ad_group_idstringyesParent ad group id; with ad_id forms the ad_group_ad resource_name.
customer_idstringyes10-digit CID, dashes stripped.
confirm_irreversiblebooleannoRequired at APPLY: must be true together with preview_id or the commit is refused. Previews run without it and carry the IRREVERSIBLE warning (a removed ad can never be re-enabled).
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

Do not remove an ad as part of recreating disapproved content elsewhere to dodge enforcement (Circumventing Systems, egregious). Removal is permanent; never present it as recoverable.

Reminder

Removal is irreversible — prefer pause if there's doubt; log the reason and never delete to mask a policy violation.

Errors

Error classMeansWhat to doRetry
CUSTOMER_NOT_FOUNDCustomer ID not found / unauthorized.Verify CID and authorization; re-auth if revoked.no
TOKEN_REVOKEDOAuth credential revoked/expired.Prompt reconnect (needs_reauth).no
INVALID_ARGUMENTRemove rejected (already removed, bad resource_name) — surfacing Google's message.Surface exact error; verify the id and state.no
PERMISSION_DENIEDScope/role does not permit writes here.Confirm adwords scope and editor role on this CID.no
MANAGER_ACCOUNT_WRITECannot mutate ads on an MCC.Target a client account.no
PARTIAL_FAILUREA bulk remove partially succeeded.Return success:true with per-row warnings; report which removed and which failed.no
RESOURCE_EXHAUSTEDRate/quota exceeded (429).Backoff 5->10->20s cap 60s; honor retryDelay.yes
PLATFORM_UNAVAILABLEGoogle Ads API 5xx.Re-check state, then retry once to avoid duplicate ops.yes

Edge cases

  • Already-REMOVED ad -> INVALID_ARGUMENT; report as already removed (no-op, not failure).
  • Idempotency on commit: a retried remove after success should detect REMOVED and not error.
  • Removing the last enabled ad in an ad group stops the group serving — warn the user.
  • Bulk remove partial_failure -> success:true with per-row warnings.
  • Preview TTL expiry -> re-preview before commit; expired token -> refresh once, retry.