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
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID, dashes stripped; operating account linked to the Merchant Center. |
name | string | yes | Unique campaign name. |
merchant_id | integer | yes | Merchant Center ID holding the products; the Ads account must be linked to it. |
campaign_priority | integer | yes | 0, 1, or 2 (higher takes precedence among Shopping campaigns sharing products). |
budget_amount_micros | integer | yes | Daily budget in micros (currency ×1e6). |
bidding_strategy | object | yes | {type:MANUAL_CPC|TARGET_SPEND|TARGET_ROAS, target_roas?}; standard Shopping only. enum-normalize. |
feed_label | string | no | Merchant feed label to scope products (replaces deprecated sales_country; do not send sales_country on v24). |
enable_local | boolean | no | Enable local inventory ads (default false). |
advertising_channel_sub_type | enum | no | Omit for standard; SHOPPING_COMPARISON_LISTING_ADS for comparison-listing (forces MANUAL_CPC). |
geo_targets | array | no | Accepted but NOT applied at create (a warning says so) — apply with gads_add_location_targeting after create. |
languages | array | no | Accepted but NOT applied at create (a warning says so) — apply with gads_add_language_targeting after create. |
status | enum | no | ENABLED|PAUSED; defaults PAUSED. |
declare_eu_political | boolean | no | Set 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_only | boolean | no | Optional. 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_id | string | no | Omit 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 class | Means | What to do | Retry |
|---|---|---|---|
CUSTOMER_NOT_FOUND | Customer ID not found / not accessible. | Verify CID and access; prompt re-auth if needed. | no |
TOKEN_REVOKED | OAuth token invalid/revoked (401). | Refresh; if still failing set needs_reauth. | no |
MERCHANT_CENTER_NOT_LINKED | The 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_ACCOUNT | Cannot create a campaign on an MCC. | Use a non-manager operating account. | no |
INVALID_ARGUMENT | Preview 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_DENIED | Missing write scope / out-of-bearer-scope (403). | Confirm scope + role; re-consent. | no |
RESOURCE_EXHAUSTED | Rate/quota exceeded (429). | Backoff 5->10->20s cap 60s, honor retryDelay, retry once. | yes |
PLATFORM_UNAVAILABLE | Google 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.