Fetch Experience Data

Get experience timeseries

Retrieve per-variant time series data for an experience (A/B test).

POST /analytics/experience/{experienceId}/timeseries

Returns metric values over time for each variation in the experiment, segmented by variation name. Use this data to compare variant performance over time and compute signals like "win-day count" (how many periods a variant beat control).

Parameters

  • experienceId (path) — required. UUID of the experience.
  • granularity — optional time bucketing: hour, day (default), week, or month.
  • mode — cumulative (default, running totals) or noncumulative (per-bucket values).
  • metrics — optional array of metric enum values to include (see table below). Defaults to conversion_rate, net_revenue_per_visitor, gross_profit_per_visitor.
  • startTs — optional 10-digit epoch timestamp in seconds. Defaults to experience start date.
  • endTs — optional 10-digit epoch timestamp in seconds. Defaults to now or experience end date.
  • filters — optional analytics filters object. See below and the Filters Reference for available fields.

Available Metrics

Pass one or more of these enum values in the metrics array:

ValueDescription
conversion_rateConversion rate
net_revenue_per_visitorRevenue per visitor (RPV)
gross_profit_per_visitorProfit per visitor (PPV)
aovAverage order value
n_visitorsVisitor count
n_ordersOrder count
net_revenueTotal net revenue

Filters

This endpoint accepts the same filters as POST /analytics/resource/{experienceId}. Key filters include:

FieldTypeDescription
deviceTypestring"any", "mobile", or "desktop"
visitorTypestring"any", "new", or "returning"
countryCodesstring[]ISO 3166-1 alpha-2 codes, e.g. ["US", "GB"]
sourceSitesOrChannelsstring[]Traffic channel names (see Filters Reference)
userBehaviorobjectVisitor behavior filter (see sub-fields below)
experimentProductsOnlybooleanOnly include products in the experiment (target products)
onlyProductIdsstring[]Shopify product IDs to include
onlyProductHandlesstring[]Shopify product handles to include

userBehavior sub-fields

All fields are optional booleans. Set to true to filter to only visitors who performed that action.

FieldDescription
viewedProductPageVisitor viewed a product page
viewedCollectionPageVisitor viewed a collection page
addedToCartVisitor added an item to cart
viewedCheckoutVisitor reached checkout

See the Filters Reference section for the full list of available filter fields.

Response Structure

The response contains a segments object keyed by variation name. Each segment has a data array of time-bucketed metric values. A variations array provides metadata including which variation is the control.

Each data point includes a dt field as a formatted date string (not Unix epoch). Format depends on granularity:

  • hour / day: "YYYY-MM-DD HH:mm:ss"
  • week / month: "YYYY-MM-DD"

Date Range Behavior

  • When startTs and endTs are omitted, the date range defaults to the experience's full lifetime (start date through end/pause date or now).
  • If the experience is paused or ended, the response is automatically truncated at the pause/end date — no data points are returned after that point.
  • If the provided startTs is before the experience start date, it is clamped to the experience start. Similarly, endTs is clamped to the experience end/pause date.
  • Clamping only applies to a window that overlaps the experience lifetime. A window that falls entirely outside it is rejected rather than clamped: HTTP 400 with { "error": "Requested time range falls outside the experience lifetime" }.
  • startTs must be strictly before endTs. An inverted range returns HTTP 400 with { "error": "Start time must be before end time" }.

Rate Limit: 50 requests per 30s window, refilling 25 tokens every 30s.

post/v25-10-beta/analytics/experience/{experienceId}/timeseries

Request

Path parameters

experienceIdstring uuid required

Request body

startTsstring

Optional analysis start timestamp as a 10-digit Unix epoch string in seconds. Defaults to the experience start date.

endTsstring

Optional analysis end timestamp as a 10-digit Unix epoch string in seconds. Defaults to now or the experience end date.

granularity'hour' | 'day' | 'week' | 'month'

Time bucket granularity. Supported values: hour, day, week, month. Defaults to day.

mode'cumulative' | 'noncumulative'

Time series mode. Use 'cumulative' for running totals or 'noncumulative' for per-bucket values. Defaults to cumulative.

metricsstring[]

Array of metric names to include in the response. When omitted, defaults to conversion_rate, net_revenue_per_visitor, and gross_profit_per_visitor. Profit metrics (e.g. gross_profit_per_visitor) require COGS to be configured for the store; when COGS are not configured (cogsConfigured is false) their values are null. Check the top-level cogsConfigured / cogsCoveragePct fields.

Response

OK

currencystring required

ISO 4217 currency code for monetary values (e.g. 'USD').

granularity'hour' | 'day' | 'week' | 'month' required

The granularity used for time bucketing.

mode'cumulative' | 'noncumulative' required

The time series mode used (cumulative or discrete).

experienceIdstring required

The UUID of the experience.

experienceNamestring required

The display name of the experience.

cogsConfiguredboolean

Whether cost of goods sold (COGS) is configured for the store. When false, profit metric values (e.g. gross_profit_per_visitor) are null in every time bucket because they cannot be computed. Only present when the request includes a profit metric.

cogsCoveragePctnumber

Fraction of revenue (0-1) backed by line items that have COGS data. 0 means profit metrics are unavailable and returned as null; a value between 0 and 1 means profit reflects partial COGS coverage; 1 means full coverage. Only present when the request includes a profit metric.

segmentsobject required

Time series data keyed by variation name. Each segment contains a data array of time-bucketed metric values. Profit metric values are null in buckets without COGS coverage; see cogsConfigured / cogsCoveragePct.

Example response

{
  "currency": "USD",
  "granularity": "day",
  "mode": "cumulative",
  "experienceId": "a1a1a1a1-a1a1-1111-aaaa-aa1111111111",
  "experienceName": "Homepage Hero CTA Test",
  "variations": [
    {
      "id": "b2b2b2b2-b2b2-2222-bbbb-bb2222222222",
      "name": "Control",
      "isControl": true
    },
    {
      "id": "c3c3c3c3-c3c3-3333-cccc-cc3333333333",
      "name": "Variant B",
      "isControl": false
    }
  ],
  "cogsConfigured": false,
  "cogsCoveragePct": 0,
  "segments": {
    "Control": {
      "data": [
        {
          "dt": "2025-01-01T00:00:00",
          "conversion_rate": 0.0312,
          "net_revenue_per_visitor": 1.84,
          "gross_profit_per_visitor": null
        },
        {
          "dt": "2025-01-02T00:00:00",
          "conversion_rate": 0.0328,
          "net_revenue_per_visitor": 1.91,
          "gross_profit_per_visitor": null
        }
      ]
    },
    "Variant B": {
      "data": [
        {
          "dt": "2025-01-01T00:00:00",
          "conversion_rate": 0.0345,
          "net_revenue_per_visitor": 1.97,
          "gross_profit_per_visitor": null
        },
        {
          "dt": "2025-01-02T00:00:00",
          "conversion_rate": 0.0361,
          "net_revenue_per_visitor": 2.05,
          "gross_profit_per_visitor": null
        }
      ]
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.