Experimentation Lab
Interactive implementation reference
Web implementation

Web Experimentation

The standard project snippet, loaded high in the document head to minimize flicker.

Browser · synchronous

Live decision runner

Simulation mode
No credential is stored in this repo. Simulation is deterministic and clearly labeled. Add a Web project ID to send real decisions and events; it stays in this browser’s local storage.

Implementation

Official docs ↗
<script src="https://cdn.optimizely.com/js/PROJECT_ID.js"></script>
window.optimizely = window.optimizely || [];
window.optimizely.push({ type: 'event', eventName: 'demo_purchase' });