Experimentation Lab
Interactive implementation reference
Integration implementation

Segment

Forward the same conversion and visitor identity to a Segment source.

Browser · analytics.js

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 ↗
Install Segment Analytics.js in the document head
analytics.identify(visitorId, { plan: 'pro' });
analytics.track('Experiment Conversion', {
  optimizelyEventKey: 'demo_purchase',
  revenue: 99,
});