Skip to main content


Optimizely Knowledge Base

Implement Optimizely with Ensighten

relevant products:
  • Optimizely X Web Experimentation
  • Optimizely X Web Personalization
  • Optimizely X Web Recommendations

This article will help you:
  • Implement the Optimizely snippet if you're using Ensighten
  • Set the order of priority for Optimizely and your analytics tags using Ensighten

When you set up Optimizely for the first time, you'll need to implement the Optimizely snippet: a single line of code that lets you start running A/B tests.

In general, we recommend that you do not load the Optimizely snippet through a tag manager. 

Loading Optimizely through a tag manager can cause issues such as page flashing, where the original version of your page is briefly displayed to visitors before the Optimizely experiment. Google Tag Manager, for example, doesn't support synchronous loading. Tag managers can also cause issues with your analytics integrations. To deliver the best experience to your visitors, we strongly recommend that you implement Optimizely outside of a tag manager.

If you must load Optimizely through a tag manager, first consider these pitfalls and implementation suggestions and please reach out to your Customer Success Manager to discuss the implications.

To use Ensighten with Optimizely, create a new deployment in Ensighten Manage:


  1. In the Project Script URL field, add your Optimizely snippet, starting with the two slashes (for example, // and click Next.

  2. Set the condition to Global and the execution to Immediate. Click Next.

  3. Set the order of priority so that Optimizely fires before other tags, including your analytics tags and any other asynchronous tags. Click Save.