How to Run A/B Tests in statpx: Variants, Conversions, and Significance
A/B Testing in statpx needs no separate experiment platform. You decide how to split traffic (a simple random assignment in your own code is enough), record which variant a visitor saw with one JS call, record the conversion with another, and statpx does the rest — including the statistics. This guide covers both calls, how experiments show up automatically, and how to read the results table on the A/B Testing page.
How A/B Testing Works in statpx
Every experiment is identified by an exp_key — a string you choose, like homepage_cta or pricing_layout. Within an experiment, each visitor is shown one variant, identified by a name you also choose, like control, green, or variant_b. Once you record the first exposure for a new exp_key, that experiment automatically appears on the A/B Testing page — there is no separate step to "create" an experiment in the dashboard.
Recording a Variant Exposure
When your code decides which variant to show a visitor, call:
Call this once per session, right when the variant is rendered — not on every pageview. The second argument is the exp_key, the third is the variant name for this visitor. statpx uses this call to compute the visitor count (the denominator) for each variant's conversion rate.
Recording a Conversion
When the goal you're optimizing for happens — a signup, a purchase, an upgrade — call:
The second argument again matches the exp_key. statpx matches the conversion back to whichever variant that session was previously exposed to, so you never have to pass the variant name again at conversion time. Pass a revenue amount as the fourth argument whenever the conversion has a dollar value — statpx totals it per variant automatically.
Reading the Results Table
The results table on the A/B Testing page shows, per variant: session count, conversion rate, revenue, uplift versus control, and a statistical significance verdict. The control variant is either the one literally named control, or — if you didn't use that name — whichever variant has the most sessions. Every other variant is shown with its uplift: the percentage difference in conversion rate compared to control.
The significance verdict runs a two-proportion test and only declares a result significant at the 95% confidence level once both groups have at least 100 sessions and at least one conversion each — small-sample noise is filtered out rather than reported as a false win. Until then, the table shows the raw numbers without a verdict, so you always know whether you're looking at a real result or one that still needs more traffic.
For background on why conversion rate is the right metric to optimize in the first place, see our conversion rate analytics guide, and for a broader look at test design, read how to use analytics data to run smarter A/B tests.
Run your first A/B test free
statpx computes conversion rate, uplift, revenue, and statistical significance for every variant automatically — just two JS calls to get started.
Start for free →The Bottom Line
A/B testing in statpx is deliberately code-first and dashboard-light: two _st() calls handle the tracking, and the dashboard handles the arithmetic that's easy to get wrong by hand — uplift, revenue attribution, and whether a difference is real or noise. Pick one exp_key, name your variants clearly (use control for the baseline), and let the significance verdict — not the leaderboard on day one — decide when you have a winner.