SCALIX help

← All tools

gads_set_campaign_bidding_strategy

Google Ads write high risk

Part of the Bidding Agent.

What it does

Set or change a campaign's bidding strategy (MAXIMIZE_CONVERSIONS, MAXIMIZE_CONVERSION_VALUE, TARGET_CPA, TARGET_ROAS, MAXIMIZE_CLICKS, TARGET_SPEND, MANUAL_CPC, or an existing portfolio strategy via bidding_strategy_resource_name). SCALIX SOP PRE-FLIGHT: for TARGET_CPA and TARGET_ROAS the campaign's trailing-30-day metrics.conversions (and conversions_value) are read first — tCPA requires >=30 conversions, tROAS requires >=60 conversions AND recorded conversion value. Below the floor the call is BLOCKED with error_class 'insufficient_conversion_data' and only proceeds when re-called with confirm_below_threshold=true. Any Smart Bidding change also emits a learning-period warning. PREVIEW->APPROVE->COMMIT. Returns {success, data:{applied:{strategy_set, target, learning_period_warning, resource_names}}, warnings}. The preview shows the campaign's current strategy (and portfolio, if any) next to the new one. 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

Ask the goal (leads/purchases/traffic), the desired strategy, and — for tCPA/tROAS — the target value. Prefer MAXIMIZE_CLICKS or MANUAL_CPC on a fresh campaign with no conversion history. This is also the correct tool when a manual keyword bid is blocked.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID, dashes/spaces stripped. Tenant context server-derived.
campaign_idstringyesNumeric campaign ID to update.
strategy_typestringyesOne of: MANUAL_CPC, MANUAL_CPM, TARGET_SPEND, MAXIMIZE_CONVERSIONS, MAXIMIZE_CONVERSION_VALUE, TARGET_CPA, TARGET_ROAS, TARGET_IMPRESSION_SHARE, or PORTFOLIO (then use bidding_strategy_resource_name). Enum-normalized uppercase.
target_cpanumbernoTarget CPA in account currency; converted to target_cpa_micros (x1e6, integer). Required for TARGET_CPA; optional for MAXIMIZE_CONVERSIONS.
target_roasnumbernoTarget ROAS as a decimal ratio (4.0 = 400%). Required for TARGET_ROAS; optional for MAXIMIZE_CONVERSION_VALUE.
cpc_bid_ceilingnumbernoMax CPC bid limit in account currency (converted to micros). REQUIRED when switching to TARGET_SPEND/MAXIMIZE_CLICKS: the update mask cannot express a bare TargetSpend, and a 0 ceiling is rejected by Google as TOO_LOW.
bidding_strategy_resource_namestringnoFor PORTFOLIO: customers/{cid}/biddingStrategies/{id}. Mutually exclusive with target_cpa / target_roas / cpc_bid_ceiling: passing both is refused.
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.
confirm_below_thresholdbooleannoSet true to accept tCPA/tROAS below the Scalix conversion floor (blocked by default).
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

Bidding-strategy changes carry no content-policy risk but spend real money: never apply a strategy/target the user did not explicitly approve, and never set targets that contradict an account-level constraint without surfacing it.

Reminder

Show current vs proposed strategy with targets in account currency; don't retain account financials 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
BIDDING_STRATEGY_NOT_SUPPORTED_FOR_CHANNELThe chosen strategy is incompatible with this campaign's advertising_channel_type (e.g. Manual CPC on PMax).Surface the platform message; pick a compatible strategy. Branch on channel type.no
CANNOT_ATTACH_BIDDING_STRATEGYPortfolio bidding_strategy can't attach (type mismatch / different currency / not found).Surface the conflict; verify the strategy resource_name and currency. Do not guess.no
MISSING_REQUIRED_TARGETTARGET_CPA/TARGET_ROAS chosen without the required target value.Ask the user for target_cpa / target_roas; do not default a number.no
INVALID_ARGUMENTBad target (e.g. negative tCPA, malformed update_mask).Surface exact platform message; fix input. Confirm micros conversion.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

  • target_cpa given in dollars but API needs micros -> convert (x1e6) and show both in preview to avoid 1,000,000x errors.
  • Switching off a portfolio strategy to a campaign-level one detaches only this campaign (the others keep the portfolio); the preview shows current_portfolio next to the new strategy.
  • Conversion-based strategies (tCPA/tROAS/MaxConv) require active conversion tracking -> if none, surface that bidding will underperform.
  • Strategy change resets the learning period -> state expected volatility window.
  • bidding_strategy_resource_name with target_cpa / target_roas / cpc_bid_ceiling -> refused before any API call (invalid_argument naming the targets that would be ignored).
  • Expired token -> refresh once, retry.
  • Preview expired before approval -> re-run validate_only before commit.