How to Split Test With Google Analytics Experiments

Split testing is the best thing you can do when you’ve got especially important pages of your site which are responsible for connecting your traffic to your offers. These are the pages which are actually responsible for converting traffic to customers, so you want to make sure the copy, page layout, links, or video which you’re showing that traffic is as optimized as possible to convert on whatever your goal may be. There is no better way to gauge a conversion rate than to create an experiment using Google Analytics on whatever it is that you want to test so that you can make changes to ultimately boost your conversion rate. This works simply by your creating a variation or variations of the page you want to test, then Google Analytics randomly splits incoming traffic to that main URL and sends it to either the original/main URL or one of the variations and tells you which converted best as it relates to your goal. Now that we’ve covered why you’d want to do it and how it works, let’s talk about how to split test with Google Analytics right now.How to Split Test With Google Analytics

How to Split Test With Google Analytics

How to Create a Google Analytics Experiment

First, you have to create the experiment itself. I’m assuming you already have a free Google Analytics account and that the code for the profile which you want to analyze has already been installed on the site in question. If you haven’t already installed Google Analytics, it’s extremely simple. If you’re using a CMS such as WordPress or Drupal, you can grab a free plugin or module, respectively to easily add the required data to your site.How to Split Test With Google Analytics Experiments

Most plugins or modules generally just ask for the Universal Analytics profile ID which you get when you create a new Google Analytics profile and it’s as simple as pasting it in the corresponding field within your plugin or module. For more information for WordPress users, refer to my video on how to add Google Analytics to your website. Once you’ve done that, you should begin receiving all kinds of data about your site within 24 hours. Refer to my recent Google Analytics reporting tab overview post for a complete run down on many of the major things you can learn from Google Analytics.

Once it’s been added to your site, access your Google Analytics profile and navigate to the “Experiments” tab under the “Behavior” section of the overall “Reporting” tab. First you’ll be prompted to name your experiment, so choose a name which relates to both the page you’ll be experimenting with and the conversion you hope to improve upon.

Next you’ll need to set your objective for the experiment. What is your goal with this experiment? Are you trying to increase plays on a video, get more people to visit your external merchandise website, visit a purchase page on your site, get more people to upload content or utilize your contact form? Maybe you just want to lower your bounce rate and step up a page to encourage people to spend more time on your site.

These are all examples of things which would be considered a trackable goal. You can choose from an existing goal you have created in the past in your Google Analytics account, you can choose from a number of existing templates, or you can create your own.

Once you have chosen the goal which will be recognized as a successful session, you can tweak a couple of important settings for the experiment.

One: how much of your traffic, as a percentage, do you want to experiment with. In other words, how much of the traffic which normally goes to that original URL do you want potentially going to the variations. Choose a lower number to ensure that more traffic is sent to the original URL, or set it to 100% to ensure that the traffic gets divided as evenly as possible in order to get a quicker verdict on which converted best.

And two: how much time do you want to give the experiment to run to find a winner. By default it’s set for at least two weeks. The more time you give it, the more conclusive the outcome will be. Similarly, the more traffic you’re sending it, the more conclusive the outcome will be. If you’re not sending much traffic to the experiment pages, then it’s going to take longer to declare a winner.

Now it’s time to give Google Analytics the variation(s) of the page which you’re experimenting with. For this to work, you need to create the variations of the page you’re testing yourself on your site.

You might try a simple change such as the text or font in your headline, or you could go ahead and overhaul the entire page. I recommend focusing on making just one or two specific changes rather than lots of changes to the page when you’re creating the variation so that you can recognize the aspect which is specifically resulting in a better conversion. The less changes you make, obviously the more, nearly identical the two variations will be on your site, so refer to the tips I give regarding canonical URLs and noindexing tags in my post on what to do before you split test in Google Analytics to save yourself from running into any duplicate content or unwanted indexing issues.

You can add multiple variations of a page, or you can just test between two and then put the winner up against another variation in a follow-up experiment. The latter is recommended so that you can keep incrementally improving your most important pages much more efficiently and know specifically what’s performing well rather than spreading the results out between too many variations. Take and keep what works best between two variations, then try tweaking a different aspect of the page in the next experiment.

How to Add Google Analytics Experiments Code To Your Site

Once you have the entered the URLs on your site for the original and variation of the page you’re testing, it’s time to add the experiment code which Google Analytics gives you to your site. There aren’t nearly as many plugins for adding this code to your site as there are for adding the basic Google Analytics code itself, and the only ones I’ve found are paid or outdated.

This is why I recommend entering the code manually yourself. To do this, simply locate the header file for your website’s theme, then find the opening <head> tag and paste the following code below it exactly:




<?php } ?>

Note that the parts which I’ve typed in all caps should be replaced accordingly with the URL of the original page you’re testing and then the unique experiment code you’re given, respectively.

Use pipes to separate individual pages if you’re testing multiple pages, ie: (is_page(3) || is_page(5) || is_page(7))

Also note that this is just for those using a CMS like WordPress or Drupal. If you’re on basic HTML, just add it directly after the opening <head> tag on the original page you wish to test. You don’t need to add anything to the variation page(s), it’s already accounted for within the code.

Some themes, especially those which don’t have a basic <head> tag in the header section, have a field within the theme settings itself where you can add your Google Analytics code. If you’re having any issues with getting your experiment code to work properly using external analytics plugins, then you can generally fix that by pasting both your general, basic analytics code here right AFTER your experiment code in that designated analytics field of your theme.

This is particularly effective as a solution if you’re getting an error message in analytics saying that your experiment code was found AFTER the Google Analytics basic code; it needs to go before it so if you cut out external plugins and paste it all in your theme’s field then this can address that issue.

After the code has been added to your site, go to step four in the “Experiments” section and Google Analytics will tell you whether or not the code was found properly. If you’re getting the error message I just mentioned, try my above technique. If everything is good, it should say that the code was found for both the original and variation page(s).

You’ll begin getting data regarding which variation is performing best in relation to your goal within 24 hours. Note that you may see an error message saying that the code wasn’t found on the original or variation pages initially as soon as you set up the experiment, but if you’re sure you entered the code correctly then check back a few hours later.

After the experiment finds a winner, you can delete the losing page then create another variation of the winning page and start another experiment to continue to improve the quality of the page you’re testing.

If it’s an important page which receives a lot of traffic and which accounts for much of your business’ success through the goals it connects to, then you’ll likely want to continue to fine tune and run it through the ringer constantly, and now you can do it yourself.

Scroll to Top