Experimentation Lab
Interactive implementation reference
Integration implementation

PostHog

Capture experimentation conversions alongside product analytics and session replay.

Browser · capture

Live decision runner

Simulation mode
No credential is stored in this repo. Simulation is deterministic and clearly labeled. Add an environment SDK key to send real decisions and events; it stays in this browser’s local storage.

Implementation

Official docs ↗
npm install posthog-js
posthog.capture('optimizely_conversion', {
  event_key: 'demo_purchase',
  visitor_id: visitorId,
  revenue: 99,
});