Integrate Optimizely for A/B testing

Updated

Use Optimizely to test A/B variants of your site.

Note

This tutorial uses custom code. Custom code is available on any paid Site plan and on Core, Growth, Agency, and Freelancer Workspace plans.

A/B testing (sometimes called “split testing”) is a method of running optimization tests on your site. To run an A/B test, you create 2 different versions of a web page that differ in 1 way — such as having different calls-to-action (CTAs). Then, split site traffic between the 2 versions and compare chosen metrics from each to determine which version (A or B) produces better results. It’s important that you only change 1 element of variant B. Otherwise, you won’t know which change led to better performance.

Before you get started

If you haven’t already, create an Optimizely account and copy your Optimizely script.

Your Optimizely script should look something like this: 

<script src="//cdn.optimizely.com/js/1111111111.js"></script>

To add Optimizely to your site: 

  1. Go to Site settings > Custom code tab
  2. Paste your Optimizely script in the Head code section
  3. Click Save changes 
  4. Publish your site 

Then, go back to your Optimizely dashboard and create your first A/B test. Your Optimizely dashboard will monitor performance and show you how each variant performs.