- Choose whether to use the bundled snippet or the Optimizely standalone snippet.
- Switch from the bundled snippet to the Optimizely standalone snippet.
This article can probably be deleted
When you set up Optimizely, you can configure the Optimizely snippet in two ways:
The bundled snippet includes both Optimizely and Optimizely Classic.
The standalone snippet includes only Optimizely. Choosing the standalone snippet turns off all experiments in Optimizely Classic.
This article describes the difference between bundled and standalone configurations. If you're setting up Optimizely, check out this article to see all the steps for implementing your snippet.
If you're moving to Optimizely Web from Classic, check out our guide for many more resources to help during your transition.
To learn how Optimizely experiments activate, read this article on the order of activation in Optimizely.
Switch to Optimizely (standalone) snippet configuration
Here's how to switch to the Optimizely (standalone) snippet configuration, with step-by-step instructions below.
In Optimizely, navigate to Settings > Implementation. If your account uses custom snippets, you might see more than one snippet listed.
Under Optimizely, in the drop-down menu, select Enabled.
Under Snippet Configuration, select Use only Optimizely.
To switch to the bundled snippet, navigate to Settings > Implementation and select
Use both Optimizely and Optimizely Classic.
The bundled snippet includes Optimizely and Optimizely Classic. It's the default setting for your snippet and allows you to keep running experiments in Optimizely Classic while you try out Optimizely.
The bundled snippet is ~50kB larger than the standalone snippet. When you're ready to transition to Optimizely, we recommend switching to the standalone snippet to reduce snippet size and improve speed and performance.
But Optimizely and Optimizely Classic use different logic to execute changes on the page, so what happens when you include both with the bundled snippet?
The bundled snippet executes all changes in Optimizely Classic experiments first. Then, it executes changes from Optimizely campaigns and experiments.
If you'd like a reminder, here's how the Optimizely Classic snippet works.
window.optimizely2? It's a special global variable that is only exposed in bundled mode. It's not a public API—it's subject to change without notice—and it will disappear when the snippet switches to standalone mode.
Feel free to sniff around in
window.optimizely2 from the browser console when you're trying to debug a web page, but don't save any code that refers to it, not even in the project's various custom JS fields. When implementing experiences, you should only use the publicly-documented Optimizely Web JS APIs, which reference
window.optimizelyand which are supported in both bundled and standalone mode.
The standalone snippet executes campaigns and experiments in Optimizely when visitors arrive to your site. When you switch to the standalone snippet, Optimizely Classic experiments are disabled.
When you switch to the standalone snippet, all currently running experiments in Optimizely Classic will be paused. Further, all Optimizely Classic functionality is removed from the snippet. We recommend that you turn off or properly transition all existing Optimizely Classic features and assets before you switch to the standalone snippet so that you don't lose experiment data.