PureStats documentation

Experiments and A/B tests

Assign deterministic variants and evaluate goals, events or revenue with guarded statistical decisions.

PureStats can run first-party A/B tests without sending visitor assignments to a third-party feature flag provider. Open Analytics → More → Experiments to define variants, weights and the conversion outcome.

Create an experiment

  1. Choose a stable experiment key such as homepage_headline.
  2. Add two or more variants whose weights total 100%.
  3. Mark exactly one variant as the control.
  4. Select a goal, custom event or revenue event as the outcome.
  5. Start the experiment when the implementation is live.

Variants and outcome definitions are locked while an experiment is running. Pause it before changing the implementation, or complete it to preserve the final result.

Assign a variant

The optional experiment module loads automatically whenever the site has a running experiment:

window.addEventListener('purestats:experiments-ready', () => {
  const variant = purestats.assignExperiment('homepage_headline');
  renderHeadline(variant);
  purestats.trackExposure('homepage_headline', variant);
});

Assignment is deterministic and respects the configured weights. Call trackExposure() only when the visitor can actually see the tested experience. Repeat calls in one session are suppressed in the browser, while the server also guarantees one exposure per experiment subject.

Read the result

Each variant shows exposures, unique converters, conversion rate, lift from control and a Wilson 95% confidence interval. PureStats applies a Holm correction when several variants are compared with the control.

A winner can appear only after the experiment has run for at least seven days, every variant has at least 100 exposures, and the adjusted result reaches 95% confidence. PureStats never stops an experiment automatically.

Device, country and traffic-source segments use the same safeguards. Segment results are diagnostic; avoid choosing a winner from a small subgroup after inspecting many segments.

Privacy and proxies

The module follows the site's consent, Do Not Track, path exclusion and traffic classification settings. It stores no raw account identity. First-party proxy installations must also forward and cache /pf-experiments.min.js.