gads_update_ad_group
Google Ads write medium risk
Part of the Google Ads Manager Agent.
What it does
Update mutable fields on an existing ad group (name, cpc_bid_micros / cpm_bid_micros, target_cpa_micros / target_roas where the strategy allows) via AdGroupService.MutateAdGroups with an update operation and an explicit update_mask (FieldMask) naming only the changed fields. Status changes are handled by the dedicated pause/enable/remove tools. PREVIEW->APPROVE->COMMIT: validate_only=true dry run -> plain-English diff (field, from-value -> to-value, with bids shown in currency) -> explicit approval -> execute (atomic: every field or none) -> confirm with UTC timestamp + audit log. Accuracy: bids/targets are micros (/1e6, currency-labeled); target_roas is a ratio (4.0 = 400%), not micros; only fields in update_mask change — omitting the mask risks unintended overwrites, so it is built strictly from the user-approved fields. The preview shows each changed bid's current and new value in the account currency (e.g. INR), and flags a bid or target moved by more than 50% in one step (Scalix SOP). 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 change an ad group's name or bid/target after the user has reviewed the impact. Always show current vs proposed values in currency, preview with validate_only, and apply only on explicit approval; for status changes use the pause/enable/remove tools instead.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
ad_group_id | string | yes | Numeric ad group id; forms the resource_name with customer_id. |
customer_id | string | yes | 10-digit CID, dashes stripped. |
name | string | no | New unique name within the campaign (trimmed; DUPLICATE_NAME if it collides). |
cpc_bid_micros | integer | no | New manual CPC bid in micros (currency*1e6). Valid only under a CPC-compatible strategy. |
cpm_bid_micros | integer | no | New CPM bid in micros where applicable. |
target_cpa_micros | integer | no | Ad-group-level target CPA in micros, if the campaign strategy supports ad-group overrides. |
target_roas | number | no | Ad-group-level target ROAS as a ratio (e.g. 4.0 = 400%), where supported. NOT micros. |
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
No content-policy risk for bid/name edits, but accuracy + explicit approval are mandatory. Do not rename or re-bid to disguise a disapproved ad group as new content to dodge enforcement (Circumventing Systems).
Reminder
Change only the user-approved fields (strict update_mask); never auto-apply, and log the before/after for audit.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
CUSTOMER_NOT_FOUND | Customer ID not found / unauthorized. | Verify CID and authorization; re-auth if revoked. | no |
TOKEN_REVOKED | OAuth credential revoked/expired. | Prompt reconnect (needs_reauth). | no |
INVALID_ARGUMENT | Update rejected (bad bid, field not settable, duplicate name) — surfacing Google's message. | Surface exact error; correct and re-preview, don't guess. | no |
FIELD_MASK_ERROR | update_mask is missing, empty, or names an unchanged/immutable field. | Rebuild update_mask from only the approved changed fields. | no |
PERMISSION_DENIED | Scope/role does not permit writes here. | Confirm adwords scope and editor role on this CID. | no |
MANAGER_ACCOUNT_WRITE | Cannot mutate ad groups on an MCC. | Target a client account. | no |
PARTIAL_FAILURE | A bulk update partially succeeded: some rows applied, others were rejected. | Return success:true with per-row warnings (index + Google's error); re-preview only the failed rows. | no |
RESOURCE_EXHAUSTED | Rate/quota exceeded (429). | Backoff 5->10->20s cap 60s; honor retryDelay. | yes |
PLATFORM_UNAVAILABLE | Google Ads API 5xx. | Re-check state, then retry to avoid double-apply. | yes |
Edge cases
- Setting cpc_bid_micros under an automated strategy returns INVALID_ARGUMENT or is ignored — warn before applying.
- Empty update_mask = no-op; reject before sending.
- Renaming to an existing name -> DUPLICATE_NAME.
- Updating a REMOVED ad group fails — cannot edit removed entities.
- target_roas passed as a percentage (e.g. 400) instead of a ratio (4.0) over-bids 100x — the preview flags any bid or target moved by more than 50% in one step when the current value can be read.
- Preview-state TTL expiry -> re-run validate_only before commit.
- One ad group per call; the commit is atomic, so a field Google rejects applies nothing.
- Expired token -> refresh once, retry.