Run A/B tests on your site

Stop guessing what works. Test it with real users and let the data decide.

Categories: a/b testing, experiments, split testing, posthog, mixpanel, feature flags, conversion, analytics, optimization, growth

Tools that power the Run A/B tests on your site stack

Setup guide

  1. PostHog: Install posthog-js in your project with npm install posthog-js. Initialize it with your PostHog API key. In the PostHog dashboard, go to Experiments and create a new A/B test. Define your control and variant, set the rollout percentage, and add the feature flag check in your code to render the correct version for each user. (open)
  2. Mixpanel: Install the Mixpanel SDK and instrument the key conversion events you want to measure (for example, Signed Up, Upgraded, or Completed Checkout). In your Mixpanel Funnels report, segment by the PostHog feature flag property to compare conversion rates between your control and variant groups. (open)
  3. Vercel: For server-side variant assignment, use Vercel Edge Middleware to read the PostHog feature flag via the PostHog Node SDK before the page renders. This eliminates any flicker from client-side flag evaluation and ensures each user consistently sees the same variant across sessions and devices. (open)