Sites

Update an A/B test

Changed on

Changes a test's definition. Only name and hypothesis can change once the test has started; key, path, variants, goal and primary_metric only while it is a draft. Changing the split of a running test is refused: archive it and create a new one, which reshuffles visitors.

patch/sites/{id}/experiments/{experiment_id}

Request

  • Base URL
    https://api.crevio.co/v1
  • Auth
    API key in header Authorization

Path parameters

id, string required

The resource's ID, as returned in its id field

experiment_id, string required

The test's ID (e.g., "exp_3f9a1c0b7d2e4a6f8b1c3d5e")

Request body

object required
key, string

The test's handle in site code, unique on the site: lowercase letters, digits and dashes (e.g. pricing-headline). Sent to the site as the x-crevio-experiment header.

name, string

What the merchant calls the test.

hypothesis, string nullable

What the test expects to learn, in a sentence.

path, string

The one page under test, e.g. /pricing or /. No trailing slash, query or fragment.

goal, string

What counts as a conversion. purchase counts orders placed through the site's checkout. Any other value is a tracker event name the site fires with window.crevio("<goal>"), such as lead_submitted or booking_requested: a visitor converts by firing it on the site after first seeing the page. pageview is refused.

primary_metric, 'conversion_rate' | 'revenue_per_visitor'

What decides the winner: the share of visitors who reach the goal, or revenue per visitor. revenue_per_visitor needs the purchase goal.

variants, object[]

2 to 4 versions, the control first.

Response

The updated test

SiteExperiment required
object, string required
id, string required
site_id, string required
key, string required
name, string required
hypothesis, string nullable required
path, string required
goal, string required
primary_metric, 'conversion_rate' | 'revenue_per_visitor' required
status, 'draft' | 'running' | 'shipped' | 'archived' required
shipped_variant, string nullable required
variants, object[] required

The versions under test. The first is the control and is keyed control; weights are whole percentages of visitors that add up to 100.

started_at, string date-time nullable required
ended_at, string date-time nullable required
results, object nullable required

How each version is doing, from visitors who saw only that version and what they did after first seeing it: the orders they placed for a purchase goal, or whether they fired the goal event. Null in lists, while the test is a draft, and when results are briefly unavailable. Recomputed at most every 5 minutes while running; frozen when the test ships.

created_at, string date-time required
updated_at, string date-time required

Changes