Vexil/Docs/A/B Testing
Dashboard

A/B Testing

Attach an experiment to any flag to measure which variant actually drives more conversions.

How experiments work

An experiment links a flag's variants to a goal event you care about — for example, "signed up" or "clicked checkout". The SDK records which variant each user sees (an impression) and which users later complete the goal (a conversion). Vexil calculates the conversion rate per variant and surfaces it in the dashboard.

Experiment lifecycle

DRAFT
Configuring variants and goal. Not collecting data yet.
RUNNING
Actively collecting impressions and conversions.
STOPPED
Data collection ended. Results are final.

Creating an experiment

  1. 1
    Open a flag detail page
    Click on the flag you want to experiment on.
  2. 2
    Go to the A/B Tests tab
    You'll see any existing experiments for this flag.
  3. 3
    Click "New experiment"
    The creation form opens.
  4. 4
    Set a name and goal event
    Give the experiment a name and enter a goal event — a short string like signup or purchase. This is what you\'ll track in your code.
  5. 5
    Choose an environment
    Experiments are scoped to one environment. Use Staging to test before running in Production.
  6. 6
    Define variants
    Each variant has a value (the flag value it represents) and a label like "Control" or "Variant A".
  7. 7
    Click "Start"
    The experiment begins collecting data immediately.

Tracking in code

After evaluating the flag, tell Vexil which variant the user saw. Then, when they complete the goal, record the conversion:

ts
// 1. Evaluate the flag and record the impression
const variant = await ff.evaluate<string>('hero-cta', { userId })
await ff.impression('hero-cta-experiment-id', {
  userId,
  variantValue: variant,
})

// 2. Later, when the user completes the goal
await ff.track('signup', { userId })
Always call ff.impression() before ff.track(). Conversions are matched to the most recent impression for that user.
← PreviousDependenciesNext →Metrics & stats