A/B Split test your landing pages for free with Google Optimize

It’s always funny to see the reactions when I told my customers that we can setup super precise A/B testing for them in a minute without any additional cost and all this with Google.

Theys are like whaaat?… Ok, so let me show you how to do that because it’s not something you may know about, as Google does not communicate a lot about it. It used to be an option inside Google Analytics named “Content Experiments” but they depreciated it and create “Optimize“. Sound like a Transformers name.

Create your account

So, first think first, when you land on the homepage you will be asked to share anonymous data with Google. It’s your choice, you are not forced to say yes and you can use the service if you don’t 😉

Google Optimize

Then you will be ending up into the Google Optimize dashboard. There I recommend you start by linked your Google Analytics account as the service work with it. It’s mean that if you don’t have a Google Analytics account you can’t use Optimize!

Google Optimize dashboard

Normally this panel will be open automatically at your first login. But if not, just click on the gray circle.

Link your Google Analytics

Then click on “Link to Google Analytics” and you will be prompt to do so.

Create your first experiment

When this is done, you can start creating your first A/B test. YAY. On your Google Optimize dashboard, click on the blue button “Create Experiment“.


You will open a side panel that will give you 3 choices. The one that interests us here is “Redirect test“. Name your experiment, add the original URL of the page you want to A/B test and click on “Create“.


Now we need to add a variation of this page. Click on “+ NEW VARIANT“.


Of course, you need to have two versions of the page you want to test ready and published on your website.

Now you have your two variants. You can, of course, add as many variants you want, for this example, we will use just two URL.


At the bottom of the page, you can see the “Targeting” link. If you click on it, you have two option; Who and When.

With the who you can choose how much of your traffic you want to put into this A/B testing and how much into which variants.


The “When” will open a new panel with a lot of options and we will not get into it on this post as they are very advanced. Let’s keep it simple;). Just note that you can go very very far with this tool.


Normally, by now you have you Analytics linked and your A/B testing experiment ready to roll. Next step will be to install the script on your website to perform the test. Don’t worry, it’s simple, especially if you use Divi.

Or of course, if you work with us as we will do that for you ;).

So back on your experiment dashboard, expand the info panel and click to “view snippet“.

Add the Google Optimize code to your website


You will get a line of code to add to your Google Analytics script. You can also just copy all the code, it’s already made with your analytics account code that you’ve linked earlier.

You can get back to this page any time if you need to copy it again so don’t worry.


Click next will get you into the second part of the code, the one that will actually make the A/B test redirection work.


Now that you have those two pieces of code you need to put them into your WordPress template.

Add the code using a plugin

Most of the template allows you to add code to the header in their options panel. Otherwise, you will need to use a plugin like:

Head, Footer and Post Injections

Add the code using Divi

If you use Divi thought, it’s simple. Go to Divi > Theme Options > Integration,  enable “header code” and past the two pieces of code, you’ve got earlier.


Ok, so now the code needed is in place and your experiment is ready to roll. Let’s activated it.

Start your experiment

On your optimize dashboard click in the gray bar where it says: “start experiment“.


And boom!


Now you can start to see your visitors going through your experiment.


If you open an incognito window with Chrome (or whatever browser you may use) and test your experiment URL you will see Google Optimize code added to it.


Et voila!


You now had set up your first A/B testing experiment for free with Google Optimize! Awesome right? Let me know how it goes for you guys and of course, shoot your questions in the comments.

Want to work with us? Get a free quote of your Divi website project today.

About the author

Hey I’m Lesly,  a French web designer , full time traveler and WordPress enthousiat since version 0.1. I write about design, security and speed mostly. On the side I’m also the co-founder of Learn Watercolors.

Like this article? Let’s discuss it then

Notify of
Inline Feedbacks
View all comments