SCALIX help

← All tools

gads_set_bid_adjustments

Google Ads write high risk

Part of the Bidding Agent.

What it does

Set campaign device bid modifiers (mobile/desktop/tablet/connected TV; bid_modifier 0 opts the device out). The campaign's device criteria are read first (a failed read stops the call): an existing one is updated by its resource name, a missing one created, and the preview shows each device's current -> proposed modifier. SCALIX SOP PRE-FLIGHT: the campaign's bidding strategy is read first and a warning is emitted when it is MAXIMIZE_CONVERSIONS, MAXIMIZE_CONVERSION_VALUE or TARGET_ROAS, because device modifiers have no effect under those strategies. The change is warned about, not blocked. PREVIEW->APPROVE->COMMIT. Returns the 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

Device/schedule bid adjustments. Use after reviewing gads_get_device_performance. Confirm the campaign is on a strategy that actually honours device modifiers (Manual CPC / Maximize Clicks / tCPA).

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID, dashes stripped.
campaign_idstringyesCampaign whose device modifiers are being set.
adjustmentsarrayyesList of {device, bid_modifier}, each device once. device: MOBILE | DESKTOP | TABLET | CONNECTED_TV (case-insensitive); bid_modifier is a multiplier, 0.1-10.0 (1.0 = no change, 1.2 = +20%) or 0 to exclude the device; anything else is refused at preview, so a percent (120) is caught. Existing device criterion -> update; missing -> create.
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

Bid adjustments influence spend distribution; require explicit approval and log the actor. Never apply a modifier the user did not approve, and explain that a 0 modifier fully excludes a device.

Reminder

Modifiers are multipliers (not money); show current vs proposed and rationale; 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
CAMPAIGN_NOT_FOUNDCampaign not found.Verify the campaign_id.no
INVALID_ARGUMENTModifier out of range or invalid device enum.Surface Google's message; correct the multiplier/device.no
MANAGER_ACCOUNT_NOT_SUPPORTEDCannot mutate criteria on a manager (MCC) account.Target a child serving account.no
PARTIAL_FAILURESome device adjustments failed while others succeeded.Return per-op errors with the device; succeeded committed.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

  • Empty adjustments -> invalid_argument naming the {device, bid_modifier} shape.
  • Device criterion already exists -> use update (not create) to avoid a duplicate-criterion error.
  • bid_modifier=0 fully excludes the device -> the preview warns that the campaign stops serving on it.
  • Automated/Smart Bidding strategy -> modifiers may be ignored; warn in preview.
  • Modifier passed as percent (120) vs multiplier (1.2) -> normalize/clarify to avoid a 100x error.
  • validate_only clean still needs approval; re-preview if the user edits a modifier.
  • Expired token -> refresh once and retry.