gads_create_demand_gen_campaign
Google Ads write high risk
Part of the Demand Gen Campaign Agent.
What it does
Creates a Demand Gen campaign (advertising_channel_type=DEMAND_GEN, no sub-type) for visual/social-style placements across YouTube, Discover and Gmail. Demand Gen CANNOT use a shared budget; the CampaignBudget.period is DAILY by default (omit the field to use a daily budget) OR set period=CUSTOM_PERIOD with total_amount_micros for a lifetime/total budget (requires start/end dates). The only selectable BudgetPeriod values are DAILY and CUSTOM_PERIOD. Geo/language and channel controls are at the AD GROUP level (not the campaign). This tool creates the budget + campaign shell; ad groups, audiences, and creatives follow (chain in one GoogleAdsService.Mutate with temp resource names). Bidding: MAXIMIZE_CONVERSIONS [+tCPA], MAXIMIZE_CONVERSION_VALUE [+tROAS], or MAXIMIZE_CLICKS. Money is micros (÷1e6). PREVIEW->APPROVE->COMMIT: validate_only=true preview (no creation) -> plain-English diff (budget type+amount, conversion goal, status) -> approval -> execute (atomic: budget and campaign together or neither) -> resource_name + timestamp + audit log. Defaults PAUSED. Returns standard envelope. 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 for visually-driven demand-generation across YouTube/Discover/Gmail. Confirm budget type (daily DAILY vs CUSTOM_PERIOD total with start/end dates), conversion goal, and that targeting will be set at the ad-group level, then require go-live approval before ENABLING. First call gads_plan_demand_gen_campaign for the campaign blueprint, operation ordering, and policy pre-checks.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID, dashes stripped; operating account. |
name | string | yes | Unique campaign name. |
budget | object | yes | {amount_micros} for a daily budget (period DAILY, the default — may be omitted) OR {total_amount_micros, period:CUSTOM_PERIOD} for a total/lifetime budget; must be non-shared (explicitly_shared=false). Micros (×1e6). period accepts only DAILY or CUSTOM_PERIOD. |
bidding_strategy | object | yes | {type:MAXIMIZE_CONVERSIONS|MAXIMIZE_CONVERSION_VALUE|MAXIMIZE_CLICKS, target_cpa_micros?, target_roas?}; enum-normalize. |
start_date | string | no | YYYY-MM-DD; required when using a CUSTOM_PERIOD total budget period. |
end_date | string | no | YYYY-MM-DD; required when using a CUSTOM_PERIOD total budget period. |
status | enum | no | ENABLED|PAUSED; defaults PAUSED. |
declare_eu_political | boolean | no | Set true ONLY if the campaign contains EU political advertising (Google requires the contains_eu_political_advertising declaration on every new campaign; omitted -> declares does-not-contain, which is a FALSE declaration for EU political ads). The preview names the declaration it sends, for the user to confirm. |
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
Demand Gen creative serves on YouTube, Discover and Gmail and is subject to editorial, Misrepresentation, and per-surface policies; AI-generated assets must be disclosed and may not depict deepfakes of real people; no prohibited/restricted content and respect copyright (no protected characters/lyrics). Restricted verticals require certification. Never recreate disapproved creative to circumvent enforcement.
Reminder
Preview with validate_only, approve the diff, default PAUSED; Demand Gen needs a non-shared budget (period DAILY by default, or CUSTOM_PERIOD with start/end dates for a total budget), sets geo/language at the ad-group level, and requires policy-clean visual creative.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
CUSTOMER_NOT_FOUND | Customer ID not found / not accessible. | Verify CID and access; prompt re-auth if needed. | no |
TOKEN_REVOKED | OAuth token invalid/revoked (401). | Refresh; if still failing set needs_reauth. | no |
OPERATION_ON_MANAGER_ACCOUNT | Cannot create a campaign on an MCC. | Use a non-manager operating account. | no |
INVALID_ARGUMENT | Preview validation failed (e.g. shared budget used, CUSTOM_PERIOD total period without start/end, campaign-level geo set instead of ad-group, sub-type sent). | Surface platform message verbatim; correct (non-shared budget, ad-group targeting, dates for CUSTOM_PERIOD, no sub-type) and re-preview. | no |
PERMISSION_DENIED | Missing write scope / out-of-bearer-scope (403). | Confirm scope + role; re-consent. | no |
RESOURCE_EXHAUSTED | Rate/quota exceeded (429). | Backoff 5->10->20s cap 60s, honor retryDelay, retry once. | yes |
PARTIAL_FAILURE | Chained campaign + ad group + creative ops partially failed. | Report which temp-resource ops failed with platform messages; re-commit failed ops so the campaign isn't left without an ad group. | no |
PLATFORM_UNAVAILABLE | Google Ads API 5xx/INTERNAL. | Retry once with backoff; do not assume creation succeeded. | yes |
Edge cases
- Budget must be non-shared; a CUSTOM_PERIOD total budget requires both start_date and end_date.
- BudgetPeriod accepts only DAILY (default) or CUSTOM_PERIOD — any other value (e.g. CUSTOM, FIXED_DAILY) is rejected.
- Geo/language/channel controls are AD-GROUP level in Demand Gen — applying them at the campaign level -> INVALID_ARGUMENT.
- Campaign without an ad group + creative won't serve; flag the ad group as a required follow-up.
- Value-based bidding needs conversion-value tracking.
- validate_only preview never executes; chained commit must be idempotent on retry.
- Default PAUSED; ENABLE only on go-live.
- Preview TTL expiry -> re-preview before commit.
- Expired token mid-call -> refresh once and retry.