Edge Experiments
A/B tests and feature flags for landing and sales pages, evaluated in Next.js proxy.ts before the page renders. Visitors keep their variant through a cookie, the page reads it on the server, and a beacon reports exposures and conversions to a results page with proper statistics.
How it works
Assigned before render
proxy.ts reads the visitor cookie, buckets them with a deterministic hash and rewrites /demo/landing to the variant route. The browser receives the right HTML on the first byte, so there's nothing to swap and no flicker.
No database at the edge
The proxy only fetches /api/config, a small JSON document with a 30s CDN cache. Assignments live in a compact cookie, so a returning visitor costs zero lookups.
Results you can defend
Exposures and conversions are deduplicated per visitor. The results page shows Wilson 95% intervals, relative uplift, a two-proportion z-test and a sample size calculator.
Try it
- Open the demo page. A chip at the bottom shows which variant you got.
- Reload: you stay in the same variant. Use "switch variant" to get a new visitor id.
- Click the call to action, then check the experiment results. Your click is one conversion.
- Use "Simulate traffic" on the results page to add synthetic visitors with conversion rates you choose.