A/B testing
Guide: running a test
Each test is one entry in the config block at the top of ab.js. Every action below is an edit to that entry, merged to main, and live within about five minutes.
Register
-
In Webflow, build both versions and add
data-ab-test="<id>"plusdata-ab-variant="<variant>"to each. Publish. Nothing changes for visitors: with no entry in ab.js every version would show, so add the entry first. -
Add the entry with
status: 'draft':'pricing-pro-cta': { status: 'draft', paths: ['/pricing'], variants: { 'control': 50, 'talk-to-sales': 50 } } -
QA each variant with
?ab=pricing-pro-cta:controland?ab=pricing-pro-cta:talk-to-sales.
Start
-
Set
status: 'running'and merge. -
Check that Experiment Viewed arrives in the Segment debugger with the right
experiment_idand bothvariation_idvalues. -
Note the start date in your experiment doc; the dashboard should filter from that date.
Pause
- Set
status: 'paused'. Everyone sees the control and tracking stops. - Use it when a variant is broken or a campaign would skew traffic.
- To resume, set it back to
running. Returning visitors get the variant they had before. - Exclude the paused period from your analysis.
Because the paused state shows the control to everyone, a visitor who was in the variant sees the page change if you pause. That is the safer default when something is broken.
Stop
-
Set
status: 'stopped'andwinner: '<variant>'. Everyone sees the winner right away. -
In Webflow, delete the losing version and remove the two attributes from the winner. Publish.
-
Remove the entry from ab.js.
Keep steps 2 and 3 in that order: removing the entry first would show both versions at once.
Rules that keep the data clean
Never change weights or add a variant while a test is running. Stop it and start a new one with a new id.
Never reuse an id; old cookies would carry over old assignments.
One test per element. Two tests can run on the same page if they touch different elements.