gads_list_experiments
Google Ads read low risk
Part of the Experiment Agent.
What it does
List experiments via GAQL on experiment: experiment_id, name, description, suffix, type, status, start_date, end_date, resource_name. Read-only; no metrics. Optional status filter validated against the ExperimentStatus enum {ENABLED, REMOVED, HALTED, PROMOTED, SETUP, INITIATED, GRADUATED} — there is no RUNNING or ENDED value. Map natural-language 'active/running' to ENABLED, and 'ended' to GRADUATED (promoted) or REMOVED depending on outcome. Default LIMIT 100 (no limit param; a warning says when the cap is hit and offers the status filter). Use to find an experiment's resource_name and status before scheduling/ending/promoting. Returns {success, data:[{experiment:{...}}], count, warnings}. Google's placeholder dates for an unscheduled experiment (start 1970-01-01, end 2037-12-31) are shown as 'not set'.
When to use it
When the user asks what A/B tests or experiments exist and what status each is in.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID; strip dashes. |
status | string | no | Optional status filter; must be one of {ENABLED, REMOVED, HALTED, PROMOTED, SETUP, INITIATED, GRADUATED} (enum-normalize upper; validated client-side BEFORE building GAQL). 'active/running' -> ENABLED; 'ended' -> GRADUATED or REMOVED. RUNNING/ENDED are NOT valid and are rejected with the valid list. |
manager_id | string | no | Optional MCC login-customer-id. |
Safeguards
Policy
Report experiment state as-is; do not assert a winner without performance data (experiment metrics are pulled separately).
Reminder
Status/dates only here — don't declare a winner without separate performance evidence.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
VALIDATION_ERROR | status is not a valid ExperimentStatus value (e.g. RUNNING or ENDED were supplied). | Reject before querying; use one of {ENABLED, REMOVED, HALTED, PROMOTED, SETUP, INITIATED, GRADUATED}. Map 'active/running' to ENABLED and 'ended' to GRADUATED or REMOVED. | no |
INVALID_ARGUMENT | Invalid status enum reached GAQL or another malformed filter argument. | Use a valid ExperimentStatus enum; surface the platform message. | no |
TOKEN_REVOKED | OAuth token expired/revoked. | Refresh and retry once; else prompt reconnect (needs_reauth). | yes |
CUSTOMER_NOT_FOUND | Customer ID not found/accessible. | Verify the CID is authorized. | no |
PERMISSION_DENIED | No access or out-of-bearer-scope read. | Confirm read access; else refuse. | no |
MANAGER_ACCOUNT_NOT_QUERYABLE | Queried an MCC; experiments live on client accounts. | Query the specific client account CID. | no |
RESOURCE_EXHAUSTED | Rate/quota exceeded (HTTP 429). | Backoff 5/10/20s cap 60s, then retry. | yes |
INTERNAL_ERROR | Transient Google server error (5xx). | Retry after backoff. | yes |
Edge cases
- No experiments -> success with count:0.
- An unscheduled (SETUP) experiment's dates are Google placeholders (1970-01-01 / 2037-12-31); they, and a missing date, read 'not set'.
- Caller passes RUNNING/ENDED -> reject with invalid_argument listing the valid ExperimentStatus values; do NOT pass it through into GAQL.
- 'active/running' maps to ENABLED; 'ended' maps to GRADUATED (promoted) or REMOVED (depending on outcome) — disambiguate before filtering.
- GAQL status enum is single-quoted as a string literal in this view; keep that consistent.
- Expired token -> refresh once and retry.