Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Code samples

Introduction of code samples provided by Optimizely.

There are many valuable applications for the JavaScript API. Be sure to modify the code appropriately before running it in production.

Use the code samples in this section in Shared Code, Project JS, or the variation code in the Visual Editor.