SCALIX help

← All tools

gads_schedule_experiment

Google Ads write high risk

Part of the Experiment Agent.

What it does

Schedule a SETUP experiment to begin (ExperimentService.ScheduleExperiment) — an async long-running operation that copies the control campaign into the experiment campaign and starts splitting traffic. Once scheduled, both arms spend real money. WRITE with preview->approve->commit: preview confirms the experiment is in SETUP and shows what will start (control campaign, split) + preview_id; commit calls ScheduleExperiment + audit. Returns {experiment, new_status:INITIATED}. This is not a mutate with validate_only — preview validates state via a read; commit invokes the dedicated RPC. PREVIEW SEMANTICS: preview verifies the experiment EXISTS, is in SETUP and has arms via live reads (not_found / invalid_argument otherwise; an experiment without arms is refused, as Google refuses it with MISSING_EXPERIMENT_ARMS); the schedule RPC itself runs only with the preview's RETURNED preview_id (identical arguments, within 30 minutes; forged or stale tokens are rejected).

When to use it

Use to launch a prepared (SETUP) experiment. Confirm the experiment is in SETUP and the user accepts that spend begins on both arms, then commit. Re-validate state at commit time since scheduling is irreversible.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID; strip dashes.
experiment_resource_namestringyesFull resource name customers/{cid}/experiments/{id} (or the ID, expanded server-side). Must be in SETUP status.
manager_idstringnoOptional MCC login-customer-id.
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

Scheduling starts real spend on both arms — confirm budget and that the test is genuine, not a relaunch of disapproved content (Circumventing Systems). Do not schedule an experiment whose treatment re-introduces previously disapproved creative.

Reminder

Scheduling starts real spend immediately; confirm budgets and that the treatment is policy-clean.

Errors

Error classMeansWhat to doRetry
EXPERIMENT_NOT_IN_SETUPThe experiment is not in SETUP status, so it cannot be scheduled.Check status via gads_list_experiments; only SETUP experiments can be scheduled.no
EXPERIMENT_ERRORScheduling failed (e.g., arms incomplete, control campaign changed).Fix the experiment arms/control then retry; surface the platform message.no
NOT_FOUNDNo experiment with that resource name.Confirm the resource name via gads_list_experiments.no
TOKEN_REVOKEDOAuth token expired/revoked.Refresh and retry once; else prompt reconnect (needs_reauth).yes
PERMISSION_DENIEDNo access or out-of-bearer-scope write.Confirm access and write scope; else refuse.no
RESOURCE_EXHAUSTEDRate/quota exceeded (HTTP 429).Backoff 5/10/20s cap 60s, then retry.yes
INTERNAL_ERRORTransient Google server error (5xx).Retry after backoff.yes

Edge cases

  • Async: success means 'initiated', not 'running' — the campaign copy happens in the background; status moves to INITIATED then running.
  • Only SETUP experiments with arms schedule; re-scheduling a running one errors, and one without arms is refused at preview.
  • Scheduling starts spend on both arms — surface this before commit.
  • Re-validate SETUP at commit (state may have changed since preview).
  • Expired token -> refresh once and retry; preview_id TTL expiry -> re-preview.