gads_add_search_themes
Google Ads write medium risk
Part of the Performance Max Agent.
What it does
Add search-theme signals to a PMax asset group by creating AssetGroupSignal rows with SearchThemeInfo via AssetGroupSignalService.MutateAssetGroupSignals. Search themes are HINTS (not keyword targeting) that tell Google AI which queries/topics convert. Returns {created:[{resource_name, text}], skipped_duplicates, warnings}. Accuracy: each theme <=80 chars; up to 50 search themes per asset group — the tool batches, validates length, dedupes, and reports any that hit the cap. Search themes get policy + low-search-volume review; the tool flags likely low-volume/brand-restricted themes. AssetGroupSignals are create/remove only (immutable). Flow: preview (validate_only=true) -> diff (theme list, count vs cap) -> approval -> execute (partial_failure=true) -> confirm + immutable audit log. 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 steer PMax toward high-intent queries the algorithm may miss. Keep each theme <=80 chars, stay within the 50-per-group cap, avoid trademark/sensitive terms, and confirm themes match real offerings before adding.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID; strip dashes. |
asset_group_resource_name | string | yes | Target PMax asset group. |
search_themes | array | yes | List of theme strings, each <=80 chars; trimmed and deduped. Up to 50 search themes per group. |
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
Search themes must reflect the advertiser's genuine offering and must not target on protected/sensitive categories or trademarked terms the advertiser lacks rights to. Max 50 search themes per asset group. Themes are hints; they do not bypass restricted-vertical eligibility. No circumventing disapprovals via theme manipulation (Circumventing Systems).
Reminder
Themes are conversion hints, not user data; no PII; account-isolated; nothing retained beyond this request.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
TOO_MANY_SIGNALS | Adding these themes exceeds the 50 search-themes-per-asset-group cap. | Reduce the theme list to fit within 50, or remove existing themes first; surface a clear error rather than silently truncating. | no |
INVALID_ARGUMENT | A theme exceeds 80 chars or is empty. | Trim/shorten the offending theme; surface which one. | no |
DUPLICATE_SIGNAL | Theme already exists on the asset group. | Idempotent skip; report as skipped_duplicate. | no |
POLICY_FINDING_SEARCH_THEME | Theme flagged for policy (trademark/sensitive/restricted). | Relay the policy finding; revise or remove the theme. | no |
TOKEN_REVOKED | Token revoked/expired. | Set needs_reauth; prompt reconnect. | no |
RESOURCE_EXHAUSTED | Quota/QPS exceeded (HTTP 429). | Backoff 5/10/20s cap 60s, retry once. | yes |
PARTIAL_FAILURE | Some themes added, others failed (length/policy/dupe). | Return per-theme errors; report added vs rejected. | no |
PLATFORM_UNAVAILABLE | Backend 5xx/INTERNAL. | Retry once after backoff. | yes |
Edge cases
- Partial success: some themes added, some rejected -> return both lists, don't fail the whole batch silently.
- Theme >80 chars -> rejected; report the exact theme and length.
- Low-search-volume themes accepted but flagged as likely-ineffective.
- Signals are immutable -> editing a theme = remove old + add new (gads_remove_search_themes).
- Caller supplies >50 themes (or adding would exceed 50) -> surface a clear error; never silently truncate.
- validate_only=true adds nothing; preview TTL expiry -> re-preview.