gads_update_account_settings
Google Ads write medium risk
Part of the Tracking Audit Agent.
What it does
Set a Google Ads account's tracking settings: turn auto-tagging ON, and set the account-level tracking URL template and final URL suffix. Turning auto-tagging off is refused (it removes the GCLID from every click: a person does that in Google Ads), and a template without {lpurl} is refused. Settings already as requested return changed: false and no preview_id. The preview shows the current values (before), the requested ones, example click and landing URLs for up to five of the account's final URLs, final URLs that already carry utm_ parameters, the campaigns whose own template or suffix this change will not reach, and, when the change alters or drops utm_ values the current template or suffix already sets, a warning that new CRM and GA4 leads get other labels. Preview->approve->commit: Google validates the change with validate_only, the user approves that preview in a later message, then commit (with preview_id) applies it and writes the audit log; confirm with gads_get_tracking_setup. Returns {preview, preview_id, next_step} or {applied, result}.
When to use it
Use when a tracking audit (or the user) asks to turn auto-tagging on or to set the account-level tracking template or final URL suffix in Google Ads account settings; preview first, then apply only after approval.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | The Google Ads account, 10 digits (dashes are stripped). |
auto_tagging_enabled | boolean | no | true turns auto-tagging on; false is refused. |
tracking_url_template | string | no | The account-level tracking template; must contain {lpurl}. An empty string clears it. |
final_url_suffix | string | no | The account-level final URL suffix (parameters only, no leading ? or &). An empty string clears it. |
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
Account-wide change: every campaign without its own template or suffix uses these values. Never apply without the user's explicit approval of the preview in a new message; never turn auto-tagging off; never point a template anywhere but the final URL (tracking redirects only).
Reminder
Show the before and after values, the example URLs and every warning, ask for approval, apply, then re-read with gads_get_tracking_setup. Changing utm values relabels new leads in the CRM and GA4.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
invalid_argument | Nothing to change, auto-tagging off requested, or a template without {lpurl}. | Pass auto_tagging_enabled=true and/or a template that starts with {lpurl}. | no |
preview_expired | The preview_id is older than 30 minutes. | Preview again and ask for approval again. | no |
preview_mismatch | The arguments differ from the approved preview. | Preview the new arguments and ask for approval again. | no |
Edge cases
- A manager account's settings do not reach its client accounts; run it on each client account.
- Campaigns with their own template or suffix keep theirs; the preview lists them.