Important: There is a better way to do this now with Cloudflare workers

Read an updated guide here, at Google Ads Open Research

How To Run Server Side A/B Tests With Google Optimize

Measure changes on your site with minimal effort and zero speed impact.

To learn about how tests are run, read our testing behavior section.

Step One: Setting Up Your Google Analytics

Each implementation of your Google Analytics requires separate work to get it working. Currently, Google Optimize does not support GA V4.

  1. Google Tag Manager Set Up Guide
  2. Gtag.JS Set Up Guide
  3. Analytics.js Set Up Guide

Find out your analytics type with this help article

Step Two: Setting Up Your Google Optimize Experiment

You will, of course, need a Google Optimize account for this step

  1. Create an experience
Create an experience in Google Optimize

2. Set your experience name

The name and URL do not matter, but be sure to set the experience type as “A/B” test.

Setting a Google Optimize experience type

3. Add a Variant and give it a good name

Adding a variant called test adding livechat

Your page will now look like this:

Google Optimize set up with variants

4. Change your page targeting to “URL equals SERVER_SIDE”

Click the pencil:

set the url for google optimize test

Set the rule to match “URL Equals SERVER_SIDE”

set the url to SERVER_SIDE for google optimize matching

You’ll get a warning you can safely ignore:

set the url to SERVER_SIDE for google optimize matching

5. Set Your Google Analytics Goal and copy your Experiment ID for Easy Landing To Use

choosing the Google Analytics objective for the experiment

6. Start The Experiment

start Google Optimize experiment

7. Ignore another warning

You do not need to install any Google Optimize code. It will slow down your site.

Google Optimize is not installed

Set Up The Experiment In Easy Landing

1. In the testing dashboard, name your experience something descriptive.

Easy Landing A/B/n testing dashboard

2. Add your Test ID from Google Optimize

adding the test ID to easy landing

3. Set up the triggers for your test

run the test when these conditions are met

4. Customize your pages:

Run as many variations as you want while changing small (or big!) parts of the page.

You have three customization options here:

  1. Add URL Param

    If you made a url parameter swap within Easy Landing already, this option allows you to easily add it or remove it.

  2. Redirect To Page

    Want to test two separate pages? This makes it easy.

  3. Add Code To Header/Footer

    Put any code you want into your page with this. Want to test if live chat actually increases conversions? This is where you’d do it.

Adding url Parameters to your page

5. Choose your traffic split

choosing the amount of traffic to send to either the control group or test experience

6. Set your test as active

set your Easy Landing test as active

Where To View Your Test Results

Easy Landing integrates directly with Google Optimize so you will be able to see your results in Google Optimize and Google Analytics.