Optimizely on the Web

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. 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 you can submit a ticket to the developer support team. We'll be happy to help.

Get Started