gads_set_video_brand_safety
Google Ads write medium risk
Part of the Video Campaign Agent.
What it does
Configure brand-safety / inventory controls for Video & Demand Gen campaigns. Inventory suitability is an ACCOUNT-WIDE setting in v24 — there is no per-campaign suitability field; setting it mutates Customer.video_brand_safety_suitability (EXPANDED_INVENTORY | STANDARD_INVENTORY | LIMITED_INVENTORY) and therefore affects ALL of the account's video/Demand Gen campaigns. Per-campaign control is via negative ContentLabel campaign criteria — digital-content-label exclusions (DV_G, DV_PG, DV_T, DV_MA, DV_UNRATED) added as ContentLabelTypeEnum criteria — on Video campaigns. Google refuses every content-label exclusion on a Demand Gen campaign ("The category requested for exclusion is invalid", probe 1 Oct 2026), so that request is refused at preview, pointing to the account-level inventory_type. A suitability already at the proposed value is flagged as changing nothing; with no content labels to add, the call returns changed: false and no preview_id (nothing to approve). Returns the resulting brand-safety posture (account suitability tier + the campaign's excluded labels). Preview->approve->commit: validate_only=true diff (account suitability current vs proposed with an explicit account-wide warning, and each added campaign content-label exclusion), explicit approval, then commit (with preview_id) sends validate_only=false server-side + audit log (the account tier and the label exclusions go as two requests). Accuracy: LIMITED is most restrictive (smallest reach), EXPANDED is broadest (largest reach, least filtered) — the preview states the reach/safety trade-off; the suitability change applies account-wide while content-label exclusions apply per campaign. 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. PREVIEW reads the account's CURRENT video_brand_safety_suitability and shows {current, proposed} with an explicit account-wide warning; the audit row records the prior value.
When to use it
Use when the user wants to tighten or loosen where video/Demand Gen ads appear (e.g. 'set the account to Limited inventory' or 'exclude DV_MA on this campaign'). Preview the account-wide suitability tier with its account-scope warning and every per-campaign label exclusion with its reach impact; widening inventory exposes the brand across all campaigns, so confirm before committing.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID, dashes/spaces stripped. Tenant context server-derived. |
campaign_id | string | no | Numeric Video/Demand Gen campaign ID. Required when supplying excluded_content_labels (per-campaign exclusions). Not used for the account-wide suitability change. |
inventory_type | string | no | ACCOUNT-WIDE content-suitability tier (BrandSafetySuitabilityEnum): EXPANDED_INVENTORY | STANDARD_INVENTORY | LIMITED_INVENTORY. Enum-normalized. Mutates Customer.video_brand_safety_suitability and affects every video/Demand Gen campaign on the account. |
excluded_content_labels | array<string> | no | Digital content label exclusions: DV_G, DV_PG, DV_T, DV_MA, DV_UNRATED (ContentLabelTypeEnum), for a Video campaign; refused on a Demand Gen campaign, which takes none. Added as negative ContentLabel campaign_criterion exclusions on the given campaign_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
Brand-safety controls protect the advertiser's reputation; loosening them (EXPANDED / removing content-label exclusions) can place ads next to mature/sensitive content. The suitability tier is account-wide, so changing it affects every video/Demand Gen campaign. Never widen inventory or drop exclusions without explicit approval, and keep restricted-vertical creatives on suitable inventory.
Reminder
State the reach-vs-safety trade-off of each change and warn explicitly that the inventory_type/suitability change is account-wide (all video/Demand Gen campaigns), while content-label exclusions are per campaign; don't retain account brand-safety settings beyond this request.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
CUSTOMER_NOT_FOUND | Customer ID not found or not linked. | Verify CID (dashes stripped); re-auth if stale. | no |
TOKEN_REVOKED | Authorization revoked / refresh token expired. | Trigger re-auth (needs_reauth); do not retry with the dead token. | no |
OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE | Content-label exclusions don't apply to this campaign type (e.g. Search). | Explain content labels are Video/Demand Gen/Display controls; do not retry on Search. | no |
INVALID_CONTENT_LABEL | An excluded content-label enum is invalid. | Surface the platform message; normalize to a valid label (DV_G/DV_PG/DV_T/DV_MA/DV_UNRATED). Don't guess. | no |
INVALID_ARGUMENT | Operation rejected (bad suitability enum / update_mask). | Surface platform message; fix input. | no |
PERMISSION_DENIED | Missing scope or read-only role. | Report missing scope / role; do not retry. | no |
MANAGER_ACCOUNT_WRITE | Target CID is a manager (MCC) account. | Ask which child serving account to target. | no |
RESOURCE_EXHAUSTED | Rate/quota limit (HTTP 429). | Backoff 5->10->20s cap 60s, honor retryDelay; retry. | yes |
PARTIAL_FAILURE | Some exclusion ops failed, others succeeded. | Report per-label; retry only failures. | no |
PLATFORM_UNAVAILABLE | Google Ads 5xx / INTERNAL / DEADLINE_EXCEEDED. | Idempotent retry with backoff. | yes |
Edge cases
- No settings supplied -> success:false 'nothing to change'.
- Switching the account to EXPANDED_INVENTORY removes filtering -> warn ads may appear beside mature content across ALL video/Demand Gen campaigns (account-wide).
- inventory_type changes Customer.video_brand_safety_suitability for the whole account, not a single campaign — confirm the user intends an account-wide change.
- excluded_content_labels require a campaign_id; supplying labels without one -> INVALID_ARGUMENT.
- Excluding all content labels drastically cuts a campaign's reach -> warn possible under-delivery.
- Duplicate content-label exclusion already present: not checked locally; Google's preview answer is returned.
- Applying content-label exclusions to a Search campaign -> OPERATION_NOT_PERMITTED.
- Expired token -> refresh once, retry.
- Preview expired before approval -> re-run validate_only before commit.