SCALIX help

← All tools

gads_exclude_product_group

Google Ads write medium risk

Part of the Shopping Campaign Agent.

What it does

Exclude a Shopping listing-group UNIT from serving so matching products stop showing, keeping the partition. The node is read first (not_found if it doesn't exist). negative is immutable (v24: 'remove then re-add it'), so the UNIT is removed and re-created excluded, with the same parent and case_value, in one request. Pass a SUBDIVISION with dimension + case_value to add a new excluded partition under it instead. Performance Max retail (asset-group listing-group filters) is not handled. The commit returns the resource_names. Accuracy: only UNIT (leaf) nodes can be excluded; excluding a node removes its bid (a warning says so). Flow: preview (validate_only=true) -> diff (the node, the operation, ops) -> approval -> execute (atomic) -> confirm + immutable audit log. Already excluded -> changed: false and no preview_id. 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 to stop serving unprofitable or out-of-strategy products (e.g., a low-margin brand). Confirm the exact case_value and that it's a UNIT node; preview which products are affected before excluding.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID; strip dashes.
ad_group_idstringyesThe node's ad group (a Shopping or Demand Gen product ad group); a mismatch is refused.
listing_group_resource_namestringyesRequired: the UNIT node to exclude (customers/{cid}/adGroupCriteria/{ad_group_id}~{criterion_id}), or a SUBDIVISION to add an excluded partition under it (with dimension + case_value).
dimensionstringnoWith a SUBDIVISION: the dimension of the new excluded partition (its siblings' dimension: BRAND/ITEM_ID/PRODUCT_TYPE/CUSTOM_LABEL_n/...). With a UNIT: optional, and it must match the node.
case_valuestringnoWith a SUBDIVISION: the value of the new excluded partition. With a UNIT: optional, and it must match the node.
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

Excluding products is a targeting change, not a policy fix; do not use exclusions to mask disapproved products that should be corrected at the feed (Circumventing Systems = egregious). Apply only the approved exclusion.

Reminder

Operates on feed attributes, not user data; account-isolated; nothing retained beyond this request.

Errors

Error classMeansWhat to doRetry
LISTING_GROUP_CANNOT_EXCLUDE_SUBDIVISIONTarget is a SUBDIVISION, which cannot be directly excluded.Exclude the UNIT leaves under it, or restructure.no
NOT_FOUNDListing-group node not found for the given dimension/value.Resolve via gads_list_product_groups; re-supply.no
INVALID_ARGUMENTInsufficient identifiers or malformed case_value.Supply the node resource or dimension+case_value.no
TOKEN_REVOKEDToken revoked/expired.Set needs_reauth; prompt reconnect.no
RESOURCE_EXHAUSTEDQuota/QPS exceeded (HTTP 429).Backoff 5/10/20s cap 60s, retry once.yes
PLATFORM_UNAVAILABLEBackend 5xx/INTERNAL.Retry once after backoff.yes

Edge cases

  • Only UNIT nodes excludable; SUBDIVISION -> exclude its leaves, or pass dimension + case_value to add an excluded partition under it.
  • Excluding a node drops its bid; re-including later requires resetting the bid.
  • Already-excluded node -> success with changed: false and no preview_id (nothing to approve).
  • Excluding the 'Other' catch-all stops all otherwise-unmatched products -> warn about broad impact.
  • Performance Max retail uses asset-group listing-group filters, which this tool doesn't handle.
  • validate_only=true excludes nothing; preview TTL expiry -> re-preview.