SCALIX help

← All tools

gads_create_shopping_campaign

Google Ads write high risk

Part of the Shopping Campaign Agent.

What it does

Creates a Shopping campaign (advertising_channel_type=SHOPPING) bound to a Merchant Center account. Sets Campaign.shopping_setting (merchant_id REQUIRED, campaign_priority 0-2 REQUIRED, optional feed_label [replaces deprecated sales_country], enable_local), builds the CampaignBudget, bidding strategy (MANUAL_CPC, TARGET_SPEND/MAXIMIZE_CLICKS, or TARGET_ROAS), — geo/language criteria are NOT set at create (a warning says so; apply them after with gads_add_location_targeting / gads_add_language_targeting). Inputs: customer_id, name, merchant_id, campaign_priority, daily budget (micros), bidding goal, optional feed_label/enable_local, geo, languages. Money is micros (÷1e6). PREVIEW->APPROVE->COMMIT: validate_only=true preview (no creation) -> plain-English diff (merchant linked, priority, budget/day, bidding goal, geo, status) -> approval -> execute (atomic: budget and campaign together or neither) -> resource_name + timestamp + audit log. Defaults PAUSED. Returns standard envelope. 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 launch product Shopping ads from a linked Merchant Center feed. Confirm the merchant_id link, campaign_priority, feed_label scope, budget, and bidding goal, and require explicit go-live approval before ENABLING. Verify the Merchant Center link exists before previewing. First call gads_plan_shopping_campaign for the campaign blueprint, operation ordering, and policy pre-checks.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID, dashes stripped; operating account linked to the Merchant Center.
namestringyesUnique campaign name.
merchant_idintegeryesMerchant Center ID holding the products; the Ads account must be linked to it.
campaign_priorityintegeryes0, 1, or 2 (higher takes precedence among Shopping campaigns sharing products).
budget_amount_microsintegeryesDaily budget in micros (currency ×1e6).
bidding_strategyobjectyes{type:MANUAL_CPC|TARGET_SPEND|TARGET_ROAS, target_roas?}; standard Shopping only. enum-normalize.
feed_labelstringnoMerchant feed label to scope products (replaces deprecated sales_country; do not send sales_country on v24).
enable_localbooleannoEnable local inventory ads (default false).
advertising_channel_sub_typeenumnoOmit for standard; SHOPPING_COMPARISON_LISTING_ADS for comparison-listing (forces MANUAL_CPC).
geo_targetsarraynoAccepted but NOT applied at create (a warning says so) — apply with gads_add_location_targeting after create.
languagesarraynoAccepted but NOT applied at create (a warning says so) — apply with gads_add_language_targeting after create.
statusenumnoENABLED|PAUSED; defaults PAUSED.
declare_eu_politicalbooleannoSet true ONLY if the campaign contains EU political advertising (Google requires the contains_eu_political_advertising declaration on every new campaign; omitted -> declares does-not-contain, which is a FALSE declaration for EU political ads). The preview names the declaration it sends, for the user to confirm.
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

Shopping ads are governed by Shopping ads policies and Merchant Center requirements: accurate product data, and prices/availability that match the landing page (mismatch is Misrepresentation, an egregious, suspension-level violation). The Ads account must be linked to the Merchant Center. Restricted/prohibited product categories follow Shopping policy. Never recreate disapproved products/campaigns to circumvent enforcement.

Reminder

Preview with validate_only, approve the diff, default PAUSED; product data and landing-page prices/availability must match — misrepresentation is an egregious, suspension-level violation.

Errors

Error classMeansWhat to doRetry
CUSTOMER_NOT_FOUNDCustomer ID not found / not accessible.Verify CID and access; prompt re-auth if needed.no
TOKEN_REVOKEDOAuth token invalid/revoked (401).Refresh; if still failing set needs_reauth.no
MERCHANT_CENTER_NOT_LINKEDThe provided merchant_id is not linked to this Ads account, or the link is pending.Establish/approve the Merchant Center <-> Ads link before creating the campaign.no
OPERATION_ON_MANAGER_ACCOUNTCannot create a campaign on an MCC.Use a non-manager operating account.no
INVALID_ARGUMENTPreview validation failed (e.g. priority out of 0-2, bidding strategy unsupported for Shopping, comparison-listing not using MANUAL_CPC, sales_country sent on v24).Surface platform message verbatim; correct and re-preview.no
PERMISSION_DENIEDMissing write scope / out-of-bearer-scope (403).Confirm scope + role; re-consent.no
RESOURCE_EXHAUSTEDRate/quota exceeded (429).Backoff 5->10->20s cap 60s, honor retryDelay, retry once.yes
PLATFORM_UNAVAILABLEGoogle Ads API 5xx/INTERNAL.Retry once with backoff; do not assume creation succeeded.yes

Edge cases

  • feed_label replaces the deprecated sales_country — do not send sales_country on v24.
  • campaign_priority must be 0/1/2; out-of-range -> INVALID_ARGUMENT; surface verbatim.
  • Comparison-listing sub-type supports only MANUAL_CPC — preview rejects other strategies.
  • Multiple Shopping campaigns serving the same products use priority to break ties — note conflicts.
  • Empty/zero eligible products in the feed -> campaign creates but serves nothing; flag with count context.
  • validate_only preview never executes; commit separate + idempotent on retry.
  • Default PAUSED; ENABLE only on go-live.
  • Expired token mid-call -> refresh once and retry.