gads_create_conversion_action
Google Ads write medium risk
Part of the Conversion Tracking Agent.
What it does
Create a conversion action (ConversionActionService). SCALIX SOP HARD DEFAULT: the action is ALWAYS created NON-BIDDABLE (primary_for_goal=false), so a new, unvalidated signal can never move Smart Bidding. 'SECONDARY' is not a Google Ads status: v24 ConversionActionStatus is only ENABLED/HIDDEN/REMOVED, and primary-vs-secondary is the separate primary_for_goal flag. If `status` is passed as PRIMARY or SECONDARY it is dropped and a warning explains this. Every response carries a promotion_reminder: observe for 7 days, then promote with gads_update_conversion_action(primary_for_goal=true). Valid `category` values (v24): ADD_TO_CART, BEGIN_CHECKOUT, BOOK_APPOINTMENT, CONTACT, CONVERTED_LEAD, DEFAULT, DOWNLOAD, ENGAGEMENT, GET_DIRECTIONS, IMPORTED_LEAD, OUTBOUND_CLICK, PAGE_VIEW, PHONE_CALL_LEAD, PURCHASE, QUALIFIED_LEAD, REQUEST_QUOTE, SIGNUP, STORE_SALE, STORE_VISIT, SUBMIT_LEAD_FORM, SUBSCRIBE_PAID, YOUTUBE_FOLLOW_ON_VIEWS (alias LEAD -> SUBMIT_LEAD_FORM). counting_type: ONE_PER_CLICK | MANY_PER_CLICK. attribution_model: GOOGLE_ADS_LAST_CLICK | GOOGLE_SEARCH_ATTRIBUTION_DATA_DRIVEN. PREVIEW->APPROVE->COMMIT. Returns {success, data:{applied:{name, primary_for_goal:false, promotion_reminder, resource_names}}, warnings}. The tag snippet is not returned. 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.
When to use it
Collect conversion_type, category, value settings, counting_type, attribution model and the lookback windows before calling. Explain that it lands as SECONDARY by design and must be promoted deliberately after a 7-day observation.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID; strip dashes. |
name | string | yes | Conversion action name, e.g. 'Purchase', 'Lead Form Submit'. Unique in account. |
conversion_type | string | no | Enum-normalize: WEBPAGE (default), UPLOAD_CLICKS (aliases IMPORT/OFFLINE), UPLOAD_CALLS, CLICK_TO_CALL, WEBSITE_CALL, AD_CALL, GOOGLE_PLAY_DOWNLOAD, GOOGLE_PLAY_IN_APP_PURCHASE. PHONE_CALL_LEAD is a *category*, not a type. Types Google creates itself (STORE_*/GA4/Firebase-imported) are rejected by the API with CONVERSION_TYPE_NOT_SUPPORTED. |
category | string | no | PURCHASE (default), LEAD/SUBMIT_LEAD_FORM, SIGNUP, ADD_TO_CART, BEGIN_CHECKOUT, PAGE_VIEW, SUBSCRIBE_PAID, BOOK_APPOINTMENT, DOWNLOAD, REQUEST_QUOTE, etc. |
counting_type | string | no | ONE_CONVERSION (->ONE_PER_CLICK, default) or MANY_CONVERSIONS (->MANY_PER_CLICK; for purchases). |
value_settings | object | no | {default_value: number (currency, NOT micros), default_currency_code: ISO-4217, always_use_default_value: bool}. |
attribution_model | string | no | GOOGLE_ADS_LAST_CLICK (default) or GOOGLE_SEARCH_ATTRIBUTION_DATA_DRIVEN. Deprecated models map to LAST_CLICK. |
click_through_lookback_window_days | integer | no | 1-90. |
view_through_lookback_window_days | integer | no | 1-30. |
status | string | no | ENABLED (default), HIDDEN, REMOVED. Lifecycle only, NOT biddability: v24 has no SECONDARY/PRIMARY status. New actions are always created with primary_for_goal=false. |
manager_id | string | no | Optional MCC login-customer-id. |
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
Conversion tracking must not collect data Google prohibits (no sensitive-category data, no PII in conversion names/labels) and must comply with the EU user consent policy (Consent Mode). Do not configure tracking to double-count or to misrepresent results to the client.
Reminder
Never embed PII or sensitive-category data in conversion names/labels; tracking must follow the client's consent policy.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
CONVERSION_TYPE_NOT_SUPPORTED | The requested conversion type cannot be created via the API (APP_INSTALL/STORE_VISIT/STORE_SALE/GA4-imported). | Direct the user to create this type in the Google Ads UI; offer WEBPAGE/UPLOAD_CLICKS/CLICK_TO_CALL instead. | no |
INVALID_ARGUMENT | Bad lookback window, currency, or category combination. | Surface the platform message; clamp click 1-90 / view 1-30 and use valid enums, then re-preview. | no |
DUPLICATE_NAME | A conversion action with this name already exists. | Choose a unique name; surface the platform message. | no |
TOKEN_REVOKED | OAuth token expired/revoked. | Refresh and retry once; else prompt reconnect (needs_reauth). | yes |
CUSTOMER_NOT_FOUND | Customer ID not found/accessible. | Verify the CID is authorized. | no |
PERMISSION_DENIED | No access or out-of-bearer-scope write. | Confirm access and write scope; else refuse. | no |
RESOURCE_EXHAUSTED | Rate/quota exceeded (HTTP 429). | Backoff 5/10/20s cap 60s, then retry. | yes |
INTERNAL_ERROR | Transient Google server error (5xx). | Retry after backoff. | yes |
account_inactive | The Google Ads account is suspended or not enabled, so Google rejects every mutate - including validate_only=true previews. Reads keep working. | Resolve the account status in the Google Ads UI (billing/policy). Do NOT tell the user to reconnect Google Ads; reconnecting cannot fix an account-state rejection. | no |
Edge cases
- value_settings.default_value is a plain currency amount (e.g., 49.99), NOT micros — do not multiply by 1e6.
- Deprecated attribution models silently mapped to LAST_CLICK -> tell the user the effective model.
- Creating UPLOAD_CLICKS is the prerequisite for offline conversion uploads — confirm the user intends offline import.
- counting_type MANY_PER_CLICK suits e-commerce; ONE_PER_CLICK suits leads — confirm to avoid over/under counting.
- Preview creates nothing; preview_id TTL expiry -> re-preview; expired token -> refresh once and retry.