Skip to main content
menu_icon.png

Everything you need to switch from Optimizely Classic to X in one place: See the Optimizely X Web Transition Guide.

x
Optimizely Knowledge Base

Optimizely snippet: One line of JavaScript to run Optimizely on your site

RELEVANT PRODUCTS:
  • Optimizely X Web Experimentation
  • Optimizely X Web Personalization
  • Optimizely X Web Recommendations
  • Optimizely Classic

This article will help you:
  • Learn about the Optimizely snippet from a non-technical perspective and how Optimizely works
  • Connect to resources about the snippet

Optimizely creates experiments on your site by executing a one-line JavaScript snippet that contains your unique Project ID. Once you implement the snippet, you can start building experiments and campaigns on your site. This snippet automatically updates to run any experiment you create in the Editor. You don’t have to change a thing.

Here's how to install the snippet:

If you're making a transition from Optimizely Classic to Optimizely X Web, you don't need to implement your snippet again. Just configure the snippet to support the type of switch you'd like to make.

How does Optimizely work: Non-technical explanation

How does Optimizely work, without getting into a technical explanation? Simple: Optimizely allows you to perform A/B testing (also known as split testing), and multivariate testing across your entire technology stack. In Optimizely, these are called experiments.

Experiments that you perform on your website and mobile web are executed via a one-line JavaScript snippet. This single line of code loads Optimizely on your site and changes the experience for visitors who are randomly bucketed into "variations." Other visitors will see a "baseline" or "original" experience. Optimizely helps you compare these different variations of an experience and determine which leads to a better user experience and more conversions.

The snippet handles how those changes execute for visitors to your site. Each snippet lives in a project in your Optimizely account. The project is a space where you'll build and manage experiments and track the results.

Optimizely collects data on your visitors and conversions and runs them through our Stats Engine to show you which variations were winners or losers, compared to your baseline, so that you can make decisions about which changes to implement permanently on your site.

Here's a quick visual of how the process works:

If you're experimenting with your mobile app or across your technology stack, Optimizely runs through a software development kit (SDK). You can learn more about our SDKs on our developer site.

How else can you use Optimizely? In addition to A/B and multivariate testing, you can: