Integration implementation
GTM + GA4
Mirror decisions and conversions into Google Tag Manager’s dataLayer for GA4 routing.
Browser · dataLayerLive decision runner
Simulation modeNo 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 ↗window.dataLayer = window.dataLayer || []
window.dataLayer.push({
event: 'optimizely_conversion',
optimizely_event: 'demo_purchase',
optimizely_user_id: visitorId,
value: 99,
});