> For the complete documentation index, see [llms.txt](https://help.recart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.recart.com/developers/public-api/optin-tool/statistics-view-of-an-a-b-test-experiment.md).

# Statistics view of an A/B test experiment

One statistics view of an A/B test experiment — the same numbers as the dashboard's experiment results. `name` picks the section; `all` returns every section in one response. A single request always returns every variant of the experiment: each section is an object keyed by the variant's opt-in tool ID, so the caller never passes `optinToolIds` — the participants are read from the experiment itself.

There are no date parameters and no `targetResolution` — every section is a total for the experiment's own window, which is derived from its status: an `ended` experiment uses its full window, a `running` one spans its start until now, and a `scheduled` one has no statistics yet and returns 400.

Statistics fields behave as in the opt-in tool views: counts and rates are never null, so a variant without activity returns 0 rather than being omitted, and rates are 0 when the denominator is 0. The exceptions are the channel-gated email/SMS fields, absent when the tool does not collect that channel, and `metric-event-summary`, whose per-variant map is sparse — only events that occurred appear, and a missing key means 0.

```json
{"openapi":"3.1.0","info":{"title":"Recart API","version":"2023-12"},"tags":[{"name":"OptinTool","description":"Opt-in tools"}],"servers":[{"url":"https://api.recart.com/app-integrations/2023-12","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Recart-API-Key","description":"It can be obtained in Recart account after contacting Support"}},"schemas":{"OptinToolExperimentViews":{"type":["object"],"required":["type","attributes"],"properties":{"type":{"type":"string","enum":["optin-tool-experiments-views"]},"attributes":{"type":"object","description":"The requested section under its name — exactly one key for a single\nview, all four for name=all. Every section is an object keyed by the\nvariant's opt-in tool ID, holding that variant's totals for the\nexperiment's window.\n","minProperties":1,"properties":{"optin-summary":{"type":"object","description":"Opt-in performance totals per variant","additionalProperties":{"$ref":"#/components/schemas/OptinToolExperimentOptinSummaryData"}},"revenue-summary":{"type":"object","description":"Attributed revenue totals per variant","additionalProperties":{"$ref":"#/components/schemas/RevenueMetrics"}},"revenue-by-optin-segments":{"type":"object","description":"Attributed revenue split by opt-in segment per variant; one\nelement per segment plus a total row\n","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/OptinToolRevenueByOptinSegmentsItem"}}},"metric-event-summary":{"type":"object","description":"Raw metric event counts per variant, available for significance\nmath. Each variant holds a sparse map whose keys are MetricEvent\nvalues — only events that occurred within the experiment's\nwindow appear, and a missing key means 0.\n","additionalProperties":{"type":"object","propertyNames":{"$ref":"#/components/schemas/MetricEvent"},"additionalProperties":{"$ref":"#/components/schemas/MetricEventStatistic"}}}}}}},"OptinToolExperimentOptinSummaryData":{"description":"Opt-in performance totals of one variant for the experiment's window —\nthe same fields as an opt-in tool's optin-summary, plus the subscribers\nthe variant collected.\n","allOf":[{"$ref":"#/components/schemas/OptinToolOptinSummaryData"},{"type":"object","required":["subscriptions"],"properties":{"subscriptions":{"type":"integer","description":"New SMS subscribers the variant collected"}}}]},"OptinToolOptinSummaryData":{"type":"object","description":"Opt-in performance totals for the range. Counts are unique sessions.\nEmail/SMS fields appear only when the tool collects that channel.\nFields are never null: a range without data returns 0 counts and\n0 rates.\n","required":["impression","teaserConfirm","teaserConfirmRate","teaserDecline"],"properties":{"impression":{"type":"integer","description":"Unique sessions in which the popup was displayed"},"teaserConfirm":{"type":"integer","description":"Unique sessions that clicked the teaser and opened the popup"},"teaserConfirmRate":{"type":"number","description":"teaserConfirm / impression"},"teaserDecline":{"type":"integer","description":"Unique sessions that dismissed the teaser"},"emailOptin":{"type":"integer","description":"Unique sessions that submitted an email address on the popup"},"emailOptinRate":{"type":"number","description":"emailOptin / impression"},"phoneNumberSubmitted":{"type":"integer","description":"Unique sessions that submitted a phone number on the popup"},"phoneNumberSubmittedRate":{"type":"number","description":"phoneNumberSubmitted / impression"},"smsOptin":{"type":"integer","description":"Unique sessions that completed the SMS opt-in"},"smsOptinRate":{"type":"number","description":"smsOptin / impression"}}},"RevenueMetrics":{"type":"object","description":"Revenue attributed to the opt-in tool: orders placed within 7 days\nof an interaction with the tool in the same session. Amounts are in\nUSD, rounded to 2 decimal places. Fields are never null: a range\nwithout attributed orders returns 0 amounts, and rates are 0 when\nthe denominator is 0.\n","required":["associatedRevenue","orders","averageOrderValue","revenuePerVisitor","orderConversionRate"],"properties":{"associatedRevenue":{"type":"number","description":"Total value of the orders attributed to the opt-in tool, in USD"},"orders":{"type":"integer","description":"Number of orders attributed to the opt-in tool"},"averageOrderValue":{"type":"number","description":"associatedRevenue / orders, in USD"},"revenuePerVisitor":{"type":"number","description":"associatedRevenue / impressions, in USD"},"orderConversionRate":{"type":"number","description":"orders / impressions"}}},"OptinToolRevenueByOptinSegmentsItem":{"allOf":[{"type":"object","required":["optinSegmentType","optinSegmentCount"],"properties":{"optinSegmentType":{"type":"string","description":"The deepest opt-in stage the sessions in this row reached\n(noOptin / emailOptin / smsOptin / emailAndSMSOptin); the\ntotal row sums the whole funnel\n","enum":["noOptin","emailOptin","smsOptin","emailAndSMSOptin","total"]},"optinSegmentCount":{"type":"integer","description":"Unique sessions whose deepest opt-in stage is this segment"}}},{"$ref":"#/components/schemas/RevenueMetrics"}]},"MetricEvent":{"type":"string","description":"Raw popup metric event identifier. Revenue is carried only by\nimpressionRevenue, emailClickRevenue and smsOptinRevenue; orderValueUSD\nis 0 for every other event.\n","enum":["teaserConfirmation","teaserDecline","smsClick","emailClick","closePopup","openMinimized","closeMinimized","impression","minimizedImpression","close","smsOptin","optinRequestSent","successClick","engagement","emailAutofill","smsAutofill","oneTimePasswordAutofill","oneTimePasswordClick","oneTimePasswordResend","oneClickVerificationClick","oneClickVerificationAutofill","oneClickVerificationResend","oneClickThisIsntMe","impressionRevenue","emailClickRevenue","smsOptinRevenue","oneClickReturningVisitorSMSClick","oneClickReturningVisitorEmailClick","oneClickReturningVisitorSuccessClick","oneClickReturningVisitorClose","oneClickReturningVisitorClosePopup","oneClickReturningVisitorCloseMinimized","oneClickReturningVisitorImpression","oneClickReturningVisitorMinimizedImpression","oneClickReturningVisitorVerificationClick","oneClickReturningVisitorVerificationAutofill","oneClickReturningVisitorVerificationResend","oneClickReturningVisitorThisIsntMe","oneClickReturningVisitorTeaserDecline","oneClickReturningVisitorTeaserConfirmation","oneClickReturningVisitorOpenMinimized","oneClickReturningVisitorAutofill","oneClickNewVisitorSMSClick","oneClickNewVisitorEmailClick","oneClickNewVisitorSuccessClick","oneClickNewVisitorClose","oneClickNewVisitorClosePopup","oneClickNewVisitorCloseMinimized","oneClickNewVisitorImpression","oneClickNewVisitorMinimizedImpression","oneClickNewVisitorVerificationClick","oneClickNewVisitorVerificationAutofill","oneClickNewVisitorVerificationResend","oneClickNewVisitorThisIsntMe","oneClickNewVisitorTeaserDecline","oneClickNewVisitorTeaserConfirmation","oneClickNewVisitorOpenMinimized","oneClickNewVisitorAutofill"]},"MetricEventStatistic":{"type":"object","description":"Raw count and attributed order value of a single metric event","required":["count","orderValueUSD"],"properties":{"count":{"type":"integer","description":"Number of times the event occurred"},"orderValueUSD":{"type":"number","description":"Value of the orders attributed to the event, in USD, rounded to 2\ndecimal places. 0 for every event other than impressionRevenue,\nemailClickRevenue and smsOptinRevenue.\n"}}},"HttpErrorBody":{"type":"object","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"object","required":["id","code","title","detail"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"}}}}}}},"responses":{"HttpError":{"description":"HTTP Error response","content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/HttpErrorBody"}}}}}},"paths":{"/optin-tool-experiments/{id}/views/{name}":{"get":{"summary":"Statistics view of an A/B test experiment","tags":["OptinTool"],"operationId":"getOptinToolExperimentView","description":"One statistics view of an A/B test experiment — the same numbers as the\ndashboard's experiment results. `name` picks the section; `all` returns\nevery section in one response. A single request always returns every\nvariant of the experiment: each section is an object keyed by the\nvariant's opt-in tool ID, so the caller never passes `optinToolIds` —\nthe participants are read from the experiment itself.\n\nThere are no date parameters and no `targetResolution` — every section\nis a total for the experiment's own window, which is derived from its\nstatus: an `ended` experiment uses its full window, a `running` one\nspans its start until now, and a `scheduled` one has no statistics yet\nand returns 400.\n\nStatistics fields behave as in the opt-in tool views: counts and rates\nare never null, so a variant without activity returns 0 rather than\nbeing omitted, and rates are 0 when the denominator is 0. The\nexceptions are the channel-gated email/SMS fields, absent when the\ntool does not collect that channel, and `metric-event-summary`,\nwhose per-variant map is sparse — only events that occurred appear, and\na missing key means 0.\n","parameters":[{"name":"id","in":"path","required":true,"description":"ID of the experiment","schema":{"type":"string"}},{"name":"name","in":"path","required":true,"description":"The view to return","schema":{"type":"string","enum":["optin-summary","revenue-summary","revenue-by-optin-segments","metric-event-summary","all"]}}],"responses":{"200":{"description":"Ok","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"description":"Always one resource of type optin-tool-experiments-views.\nattributes holds the requested section under its name,\nkeyed by variant optinToolId — one section key for a\nsingle view, all four for name=all.\n","$ref":"#/components/schemas/OptinToolExperimentViews"}}}}}},"4XX":{"$ref":"#/components/responses/HttpError"},"5XX":{"$ref":"#/components/responses/HttpError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.recart.com/developers/public-api/optin-tool/statistics-view-of-an-a-b-test-experiment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
