SCALIX help

← All tools

gads_create_portfolio_bidding_strategy

Google Ads write high risk

Part of the Bidding Agent.

What it does

Create a standalone portfolio BiddingStrategy (shareable across campaigns). Portfolio-eligible types in v24: TARGET_CPA (target_cpa_micros), TARGET_ROAS (target_roas as a ratio, e.g. 4.0 = 400%), TARGET_SPEND / MAXIMIZE_CLICKS (target-less), MAXIMIZE_CONVERSIONS (optional target_cpa), MAXIMIZE_CONVERSION_VALUE (optional target_roas) — all five are legal members of the v24 BiddingStrategy scheme oneof; target-less types create an empty scheme message. TARGET_IMPRESSION_SHARE is not supported by this tool (set it on the campaign via gads_set_campaign_bidding_strategy). PREVIEW->APPROVE->COMMIT: previews via validate_only=true showing type and targets (CPA in micros/1e6 account currency; ROAS as a ratio), waits for approval, commits with validate_only=false (atomic), returns the strategy resource_name and writes the audit log. Creating the strategy does NOT assign it to campaigns and does NOT change spend until assigned. Targets in account currency -> micros. Returns {success, data:{applied:{op, name, type, resource_names}}, warnings}; the preview's amounts give the target CPA in the account currency (e.g. 300.00 INR). 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 create a reusable automated bidding strategy to apply across campaigns. Confirm the type is portfolio-eligible (TARGET_CPA / TARGET_ROAS / TARGET_SPEND / MAXIMIZE_CONVERSIONS / MAXIMIZE_CONVERSION_VALUE) and the targets are correct before committing, then assign it to campaigns separately. Note that Performance Max campaigns cannot use portfolio strategies (their Max Conversions/Value must be campaign-embedded).

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID, dashes stripped.
namestringyesStrategy name unique within the account; trimmed.
typestringyesPortfolio types: TARGET_CPA / TARGET_ROAS / TARGET_SPEND (alias MAXIMIZE_CLICKS) / MAXIMIZE_CONVERSIONS / MAXIMIZE_CONVERSION_VALUE (enum-normalized). Target-less types create an empty scheme oneof. TARGET_IMPRESSION_SHARE and other types are rejected with a clear message listing this supported set; final eligibility is enforced by the platform.
target_cpanumbernoAccount-currency CPA -> micros (x1e6); required for TARGET_CPA, optional for MAXIMIZE_CONVERSIONS.
target_roasnumbernoRatio (4.0 = 400%); required for TARGET_ROAS. Do NOT pass a percentage (400).
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

Bidding strategy controls real spend; require explicit approval of type and targets and log the actor. Never set a target the user did not approve in the preview.

Reminder

Targets are money-relative — confirm CPA currency/micros and ROAS as a ratio (not %); log actor; never expose tokens.

Errors

Error classMeansWhat to doRetry
CUSTOMER_NOT_FOUNDAccount not found/linked.Verify CID/authorization.no
TOKEN_REVOKEDAuthorization expired/revoked.needs_reauth.no
INVALID_BIDDING_STRATEGY_TYPEType is not supported by this tool (e.g. TARGET_IMPRESSION_SHARE) or not portfolio-eligible in v24.Choose TARGET_CPA / TARGET_ROAS / TARGET_SPEND (MAXIMIZE_CLICKS) / MAXIMIZE_CONVERSIONS / MAXIMIZE_CONVERSION_VALUE; set TARGET_IMPRESSION_SHARE on the campaign instead.no
INVALID_ARGUMENTMissing/invalid target for the chosen type, duplicate name, or wrong-scale target (ROAS as % vs ratio).Surface Google's message; provide the required, correctly-scaled target.no
MANAGER_ACCOUNT_NOT_SUPPORTEDCannot create a strategy on a manager (MCC) account (use the cross-account strategy flow instead).Target a child serving account or use the cross-account path.no
PERMISSION_DENIEDNo write access / out of bearer scope.Confirm role/scope.no
RESOURCE_EXHAUSTEDRate/quota limit (HTTP 429).Backoff 5/10/20s cap 60s; honor retryDelay.yes
INTERNAL_ERRORTransient 5xx.Retry once after backoff.yes

Edge cases

  • TARGET_ROAS without target_roas, or TARGET_CPA without target_cpa -> validation error before commit.
  • Target-less MAXIMIZE_CONVERSIONS / MAXIMIZE_CONVERSION_VALUE / TARGET_SPEND create an empty scheme oneof (valid); a target can be added later.
  • Other standard-only/PMax-only type requested -> reject with a clear message (set it on the campaign instead).
  • Performance Max campaigns cannot attach a portfolio strategy -> note when the user intends PMax.
  • target_roas passed as a percentage (400) vs ratio (4.0) -> normalize/clarify; the wrong scale is a serious money risk.
  • Duplicate strategy name -> error; suggest a unique name.
  • validate_only clean still needs approval before commit.
  • Creating the strategy doesn't change spend until assigned to a campaign -> note it.
  • Expired token -> refresh once and retry.