Optimizely on the Web

Check out the JavaScript API migration guide if you are looking to migrate from Optimizely Classic to Optimizely X.

The Optimizely JavaScript API provides a way for developers to modify the default behavior of Optimizely on web pages.

The Optimizely snippet is a JavaScript file that contains all the logic needed to run Optimizely experiments on a web page. Using the JavaScript API, you can modify the default behavior of the Optimizely Snippet to target activation based on specific page content or events, query the state of activation, bucketing, or conversion for use in custom analytics packages, and force visitors into specific variations, among other capabilities.

Refer to the API reference to see the full capabilities of the JavaScript API, and read our best practices for improving site performance with Optimizely article. If you're using the JavaScript API for the first time, go to Getting started which walks through how to access Optimizely data in a web browser and make API function calls.

If you have any questions about using the JavaScript API, you can ask the developer community or submit a ticket to the developer support team. We'll be happy to assist you.

Get Started