A/B Testing Lab
A public, sanitized rebuild of the A/B landing platform I run in production (the original is under NDA): config-driven split tests, weighted traffic rollout, and sticky version assignment — with all employer branding, code, and data removed.
A public, sanitized rebuild of the A/B landing platform I run in production (the original is under NDA): config-driven split tests, weighted traffic rollout, and sticky version assignment — with all employer branding, code, and data removed.
- 01 / GOAL
Config-driven experiments: each landing owns a plain _config.ts declaring its versions, active flags, and relative rollout weights (e.g. 50/30/20).
- 02 / GOAL
Middleware resolves the version in one pass — ?v= preview param, then cookie, then weighted random — and persists it in a 365-day path-scoped cookie for sticky sessions.
- 03 / GOAL
Each version is a fully independent page via Next.js parallel routes (@v1/@v2/@v3) with its own sections, layout, and theme.
- 04 / GOAL
Deactivating a version excludes it from rollout and reassigns its audience on the next visit, while keeping it reachable via ?v= for QA and stakeholder preview.
The assignment logic lives in an Edge-safe pure module shared by middleware and server components; experiment configs sit next to their pages and are aggregated in a single registry, so changing a rollout is a one-object edit. The production original added CMS-managed experiment records, atomic impression counters for least-shown balancing, conversion analytics with first-touch attribution, and CRM integration — intentionally not reproduced here.