Create a custom result query
Creates a custom result query, or reuses one already computed. Beta.
Every field is optional; an empty body asks the same question the snapshot read answers. Unlike that read, this one can group by any dimension, narrow the window, and scope to a product group.
Not real time. A query matching one computed within the last hour
returns that snapshot with the same id and no recomputation, and a
query identical to one already running attaches to it rather than
starting a second. So results can be up to an hour old, and polling
faster than that changes nothing.
Answers 200 when a computed snapshot already covers the query and
202 when one is being computed. Either way the body identifies the
query and carries no rows: read those from
GET /experiments/{id}/results/{query_id}.
A test that has not run yet returns 422 results_not_available:
there is no traffic to compute from until it starts.
This is a read: it derives from data you already have and changes
nothing, so a read_experiments token may call it.
Authorizations
Bearer tokens created in the ABConvert admin under
Settings → MCP & API Access. Scopes:
read_experiments and write_experiments (write implies read; the
default is read). See
Authentication for which scope each
request needs.
Path Parameters
The test's numeric ID as a string, for example "3021".
^[0-9]+$"3021"
Body
Group the rows by one or two dimensions. Order doesn't
matter: it names a query, and the same pair in either
order is the same query. Naming the same dimension twice
returns 422 duplicate_breakdown_dimension. Grouping by
product_id also needs product_group_id (that group is
what the products are resolved from), and without it the
request returns 422 product_id_requires_product_group.
1 - 2 elementsA dimension a custom result query can group by. product_id requires
product_group_id, which scopes it to that product group's products.
date, country, market, device, visitor_type, traffic_channel, traffic_platform, referral_domain, landing_page, utm_source, utm_medium, utm_campaign, utm_term, utm_content, product_id Which visitors count. assignment includes every visitor
put in a test group; exposure only those the test
actually reached. exposure is only available on tests
measured that way; asking for it elsewhere returns 422
sample_basis_unsupported.
assignment, exposure Scope the query to one product group. Read the id from a
test's product_group; any other value returns 422
product_group_not_found.
^[a-fA-F0-9]{24}$Inclusive window, both bounds required. Defaults to the
test's own lifetime. An unknown key here returns 422
invalid_date_range.
The window is narrowed to the days that can hold data: no earlier than the day the test started, no later than today. Asking for more isn't an error. The window isn't narrowed to the day the test ended: orders count on the day they were placed, so a window past the end date picks up conversions from visitors assigned before it.
A window that can hold nothing at all (ending before the
test started, or beginning after today) returns 422
date_range_out_of_bounds.
Response
A computed snapshot already answers this query.
A custom result query job. Beta.
status is pending until the snapshot is computed, then completed
or failed. The result fields are present only when completed.
"results_query"Treat as opaque. Never parse it.
"66d3b91c4f2a7e5081c9a3b7"
"3021"
pending, completed, failed Why the query failed, in plain language. Present only when status
is failed. Run the query again; if it fails again, send support
this text and the query id.
Whole-test totals. Present on a query with no breakdown; a
dimensional query answers with breakdown.rows instead, and
carries no separate totals.
Present when the query named a breakdown.