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
- 1Open a flag detail pageClick on the flag you want to experiment on.
- 2Go to the A/B Tests tabYou'll see any existing experiments for this flag.
- 3Click "New experiment"The creation form opens.
- 4Set a name and goal eventGive the experiment a name and enter a goal event — a short string like
signuporpurchase. This is what you\'ll track in your code. - 5Choose an environmentExperiments are scoped to one environment. Use Staging to test before running in Production.
- 6Define variantsEach variant has a value (the flag value it represents) and a label like "Control" or "Variant A".
- 7Click "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:
Always call
ff.impression() before ff.track(). Conversions are matched to the most recent impression for that user.