My preferred ways to design different types of experiments in Google Optimize

Michal Pařízek
Google Optimize Handbook
4 min readJun 3, 2018


I’ve been working with Google Optimize nearly for a year now and I must say it is quite a robust tool which can be used for various A/B tests.

Those are essentially the ways how you can modify an experiment variant in Google Optimize:

  • Change text
  • Reorder objects
  • Modify HTML
  • Modify CSS
  • Run a JavaScript

Choosing the right (and the easiest) way depends a lot on the type of an experiment you want to run. Let me illustrate few typical experiment examples and how they can be done using Google Optimize.

A copy experiment

Changing a copy is the easiest thing you can do in Google Optimize. It can be done simply by rewriting a copy by using a visual editor:

Editing an existing text is the easiest thing you can do in Google Optimize.

Inclusion/exclusion experiments

One of my favourite experiments is inclusion/exclusion experiement. You test either add or remove elements of a page to figure out what are the elements which are key for your customers. It is a great way to optimize e.g. product page to find out the importance of different elements like customer ratings, testimonials, videos, reviews etc.

In Google Optimize it is much easier to remove elements than adding them. So when you want to test a new feature, it is easier to deploy it to 100% of your customers and then hide it for 50% of them in Google Optimize.

How? There are essentially three ways:

Remove an element in a visual editor

  • It is the easiest way but it has limits.
  • It will remove the element only from the editor’s page.
  • You risk breaking the design on mobile/tablets.

Remove/hide an element by using CSS

  • It is much cleaner way.
  • By using a CSS selector you pick the desired element and make it disappear.
  • By chosing a right CSS selector you can make the change effective on multiple pages.
You can edit style of any element. First, you need to select it correctly. Then, just add the the right attirbutes and values.

Remove/hide an element by using JavaScript

  • A very similar like the CSS method.
  • You select an element (using CSS selectors) and make it disappear with JavaScript.

Modifying multiple pages (e.g. product pages)

Sometimes you need to make smaller or bigger changes to multiple pages:

  • different prices,
  • new layouts,
  • different product sortings etc.

The most versatile method how to do so is by using JavaScript. You limit targeting of the experiment to desired pages and write a JavaScript code which does the necessary change(s) on those pages.

What I do love about Google Optimize is the specter of targeting options. From standard URL rules, through geo and technology rules to robust ways: a JavaScript variable and my favourite DataLayer variable.

Using JavaScript is a powerful method and you can do almost anything to your website.

A new checkout process

Testing a new checkout process is surprisingly easy in Google Optimize. Ask your IT to develop the new checkout on a different URL.

Then, in Google Optimize, chose a Redirect test. The redirect test (or sometimes known as a split URL test) simply redirects half of your traffic to another URL. The redirect happens at the original variant, in the very beginning of page loading.

It is a great way how to test a new checkout. Or also how to test static pages.

This is how you define the testing variant of your Redirect experiment.

Changes to a non-landing page

In case you want to run an experiment at a non-landing page, there is an elegant way how to set up the variant experience.

You need to ask your IT to set the variant experience to display when browser cookie X contain value Y.

Then, in Google Optimize, run a simple JavaScript at your variant experience. The JavaScript will set the cookie X containing value Y to a customers browser.

This is how it can look like:

A simple JavaScript which sets a pre-defined cookie with a pre-defined value.

The only drawback is that the cookie injection happens after customer visits your website and view at least one page. So the new design or feature won’t be visible at the landing page during the first page view.

Those are my favourite techniques I use often to design my experiments. I am really interested how you design your experiments. Do you use anything else? Share it with the community in comments below, please!