SCALIX help

← All tools

gads_upload_text_asset

Google Ads write low risk

Part of the Ad Extensions Agent.

What it does

Create a reusable text asset (headline/description/structured-snippet text) in the account asset library via AssetService.MutateAssets, returning the immutable asset resource name. Inputs: the text string and an optional name. Returns {resource_name, asset_id, text, char_count}. Note: most RSA headlines/descriptions are supplied INLINE at ad creation rather than as shared assets; use this only when a shared/reusable text asset is genuinely needed (e.g., callout/snippet libraries or PMax text linked by reference). Accuracy: the asset itself has no hard length cap, but downstream placements do (RSA headline <=30, description <=90) — the tool reports char_count and flags likely limit breaches against the intended_field without blocking, since the limit is enforced when linked. Text assets are de-duplicated by content. Flow: preview (validate_only=true to catch editorial/format errors) -> show parsed text + char_count + any limit warning -> approval -> execute -> 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 only when a reusable/shared text asset is required; for standard RSA copy prefer inline creation at ad-build time. Confirm the text passes editorial policy and fits the target field's char limit before creating, since the asset is immutable.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID; strip dashes.
textstringyesThe text content; trimmed of leading/trailing whitespace. Emoji/zero-width characters count as 2+ chars against downstream limits — normalize before counting.
namestringnoOptional Asset.name; if provided must be unique in the account.
intended_fieldstringnoOptional hint (HEADLINE/DESCRIPTION/CALLOUT) used only to compute and warn against the relevant char limit; not sent to the API.
validate_onlybooleannoOptional. 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_idstringnoOmit 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

Text must meet Google editorial standards: no excessive/gimmicky capitalization, no gimmicky punctuation/symbols, no word/claim repetition, no clickbait, correct spelling/grammar, and no claim the landing page cannot support (Misrepresentation = egregious, immediate suspension).

Reminder

Never embed user PII or member-derived data in text assets; do not retain the text beyond this request.

Errors

Error classMeansWhat to doRetry
INVALID_ARGUMENTEmpty text or text violating asset constraints.Surface the platform message; request corrected text.no
ASSET_FIELD_TYPE_ERROR_INVALID_TEXTText fails editorial validation (capitalization, punctuation, repetition).Report the specific editorial flag; have the user revise copy — do not auto-rewrite without approval.no
DUPLICATE_ASSET_NAMEAsset name already exists in the account.Use a unique name or reuse the existing asset.no
TOKEN_REVOKEDToken revoked/expired.Set needs_reauth; prompt reconnect.no
RESOURCE_EXHAUSTEDQuota/QPS exceeded (HTTP 429).Backoff 5/10/20s cap 60s, retry once.yes
PLATFORM_UNAVAILABLEBackend 5xx/INTERNAL.Retry once after backoff.yes

Edge cases

  • Text length within asset limits but exceeds the intended_field limit -> succeed with a warning so the link step doesn't fail later.
  • Identical text already an asset -> returns existing resource name (dedupe).
  • Text asset is immutable and non-deletable — to change it, create new + re-link.
  • Whitespace/zero-width/emoji silently inflate char count vs visible length — normalize before counting.
  • validate_only=true returns no resource_name; create still needs approval.