gads_create_conversion_value_rule
Google Ads write medium risk
Part of the Conversion Tracking Agent.
What it does
Create a conversion value rule (ConversionValueRuleService) that adjusts reported conversion value when a condition matches: action ADD (add a fixed amount) or MULTIPLY (scale by a factor), optionally conditioned on DEVICE (MOBILE/DESKTOP/TABLET), GEO_LOCATION, or AUDIENCE. status=ENABLED. Note: value rules must be activated at the account/campaign level (ConversionValueRuleSet) before they take effect. WRITE with preview->approve->commit: preview = mutate validate_only=true + diff (action, value, condition) + preview_id; commit = the same call plus that preview_id after the user approves in a later message (the server then runs the real mutate) + audit. Returns {conversion_value_rule_id, resource_name}. The 'value' is a plain amount (ADD) or a multiplier (MULTIPLY), not micros. 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
Use to model how much more/less a conversion is worth by device/location/audience. Preview the action, value, and condition; confirm the rule reflects real value differences; then commit. Remind the user it must be activated via a value rule set to take effect.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID; strip dashes. |
action | string | yes | ADD (default) or MULTIPLY. ADD: value is a currency amount; MULTIPLY: value is a factor (e.g., 1.5). |
value | number | yes | Amount to add (ADD) or factor to multiply by (MULTIPLY). Not micros. |
condition_type | string | no | Optional: DEVICE, GEO_LOCATION, or AUDIENCE. |
condition_value | string | no | Condition operand, e.g. MOBILE/DESKTOP/TABLET for DEVICE; geo target ID for GEO_LOCATION; user list for AUDIENCE. |
manager_id | string | no | Optional MCC login-customer-id. |
geo_match_type | string | no | GEO_LOCATION conditions only: LOCATION_OF_PRESENCE (default; physical location only) or ANY (presence or interest). Proto-required — always sent. |
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
Value rules change reported conversion value and Smart Bidding inputs; use them to reflect genuine differences in lead value, not to inflate ROAS. Conditioning on AUDIENCE must respect customer-data terms and not proxy protected classes in restricted verticals (employment/housing/education/credit).
Reminder
Value rules alter reported value and bidding; configure them to reflect real value differences, not to flatter ROAS.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
INVALID_ARGUMENT | Invalid action/value/condition combination. | Surface the platform message; correct the operation or condition and re-preview. | no |
CONVERSION_VALUE_RULE_ERROR | Value rules not enabled for the account, or an overlapping rule conflict. | Enable conversion value rules / resolve the conflict; 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 |
Edge cases
- value is plain currency (ADD) or a factor (MULTIPLY) — not micros.
- A created rule does nothing until added to an active ConversionValueRuleSet -> tell the user the extra activation step.
- Overlapping conditions (e.g., two device rules) can conflict -> surface CONVERSION_VALUE_RULE_ERROR.
- Value rules require conversion-value-based bidding (e.g., tROAS/Max Conversion Value) to be meaningful.
- Preview creates nothing; preview_id TTL expiry -> re-preview; expired token -> refresh once and retry.