SCALIX help

← All tools

gads_set_campaign_conversion_goal

Google Ads write high risk

Part of the Conversion Tracking Agent.

What it does

Set which conversion goals a campaign bids toward (campaign_conversion_goal.biddable), or revert to account-level goals with revert_to_customer_level=true. SCALIX SOP: setting campaign-level goals means the campaign STOPS inheriting account-wide goal changes, so a `reason` is REQUIRED (error_class 'reason_required' otherwise) and is written to the audit log; a warning restates the inheritance trade-off. Reverting needs no reason. PREVIEW->APPROVE->COMMIT. 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

Only when intentionally overriding account defaults (e.g. a seasonal campaign bidding on purchases only). Ask why, and which conversion actions should drive bidding.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID of the Google Ads ACCOUNT (NOT the conversion-source account), dashes/spaces stripped. Tenant context server-derived.
campaign_idstringyesNumeric campaign ID.
goalsarray<object>yesEach: {category (e.g. PURCHASE, SUBMIT_LEAD_FORM, PAGE_VIEW, SIGNUP...), origin (e.g. WEBSITE, APP, STORE, GOOGLE_HOSTED), biddable (bool)}. The tool resolves the existing CampaignConversionGoal for that category+origin and updates biddable (update_mask=['biddable']). Mutating any goal auto-sets the campaign to CAMPAIGN-level goal sourcing. Enum-normalize category/origin.
revert_to_customer_levelbooleannoIf true, switch the campaign back to inheriting account-default goals by setting ConversionGoalCampaignConfig.goal_config_level=CUSTOMER via ConversionGoalCampaignConfigService. Mutually exclusive with supplying biddable goal overrides.
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.
reasonstringnoWhy this campaign overrides account-level goals. Required unless reverting; audit-logged.
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

Conversion-goal changes alter what Smart Bidding optimizes for and spend allocation; never change a campaign's goals without explicit approval, and don't enable goals based on conversions the account isn't actually tracking (misrepresenting results).

Reminder

Goal config drives bidding; confirm exactly which category/origin goals are biddable (mutating any auto-switches the campaign to CAMPAIGN-level sourcing) and don't retain conversion data beyond this request.

Errors

Error classMeansWhat to doRetry
CUSTOMER_NOT_FOUNDCustomer ID not found or not linked.Verify the CID (the Ads account, not the conversion account; 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
CONVERSION_GOAL_NOT_FOUNDNo CampaignConversionGoal exists for the given category+origin (Google hasn't created one).Tell the user the goal category/origin isn't present; verify a matching conversion action exists. Don't fabricate a goal.no
MUTATE_OPERATION_NOT_SUPPORTEDAttempted create/remove on a CampaignConversionGoal (only update is allowed).Use update on the auto-created goal; correct the operation.no
INVALID_ARGUMENTBad category/origin enum or update_mask.Surface platform message; normalize enums.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
PARTIAL_FAILURESome goal updates failed, others succeeded.Report per-goal; retry only failures.no
PLATFORM_UNAVAILABLEGoogle Ads 5xx / INTERNAL / DEADLINE_EXCEEDED.Idempotent retry with backoff.yes

Edge cases

  • Supplying biddable goal overrides automatically switches the campaign to CAMPAIGN-level sourcing (ConversionGoalCampaignConfig.goal_config_level=CAMPAIGN) — flag that the campaign will stop inheriting account-default goal changes.
  • Disabling all biddable goals leaves the campaign with nothing to optimize -> warn Smart Bidding will misbehave.
  • category+origin with no existing goal -> CONVERSION_GOAL_NOT_FOUND, don't auto-create.
  • customer_id must be the Ads account, not the conversion-tracking account -> validate and surface if mismatched.
  • revert_to_customer_level supplied together with biddable goals is contradictory -> reject; pick one.
  • No goals and no revert supplied -> success:false 'nothing to change'.
  • Expired token -> refresh once, retry.
  • Preview expired before approval -> re-run validate_only before commit.