How to use Google Analytics Content Experiments

Today I’m going to show you how to set up A/B testing with Google Analytics Content Experiments.

You may be asking yourself what is “A/B testing”? Well as always I think the best way to explain is to provide a real world example. We’ve just launched our new site iconsetc.com, a premium site where users subscribe to get access to over 325,000 icons.

We had two ideas for the sign up page where users purchase our subscription one was long with FAQ’s and one was short with a different sales pitch heading. Now wouldn’t it be great to have some users go to sign up “page A” and some users go to sign up “page B” and track which page results in more sale conversions for our site? Google Analytics Content Experiments allows us to do just that.

We are going to define a control page (page A) and a variation (page B) and expose our users to the different versions of the page to determine which version will result in more conversions.

First you’re going to need a Google Analytics account and already have your Tracking code installed on your website, if you don’t already have a Google Analytics account you can sign up here: http://www.google.com/analytics/

To create a new experiment navigate to the Behavior section and click on the Experiments link on the sidebar. Above this table, you will find a button Create experiment, click on it.

Now lets set up our experiment!

Choose an experiment objective

Name for this experiment: Name your experiment, ours is Icons Pro Sign Up.

Objective for this experiment: Google Analytics Content Experiments needs a metric by which the experiment gets evaluated, for us this is our order confirmation page that the users gets redirected to from PayPal after purchase. If you already have an existing goal click Select a metric. If you don’t have an existing goal, Ecommerce or AdSense metrics click Create a new objective.

Note: You can skip this steps if you already have an existing goal.

Goal setup: For the goal setup, select Custom and then click Next step.

Goal description: Enter the Name of your goal description, ours is IconsETC Order. Next for Type select Event then click Next step.

Goal details: Fill in all the Event conditions, leave the Value blank, also the option Use the Event value as the Goal Value for the conversion should be set to Yes. Below is what we used for our Event conditions:

Category "Equals to":Icons Order

Action "Equals to":action

Label "Equals to":Completion Page

Value "Greater than":Leave this option blank, do not enter anything

Next click Create Goal, now we have our goal.

After you’ve created your goal click on the Reporting menu option in the main Google Analytic menu next to the logo at the top of the page, this should take you back to the All Experiments page.

Click on the title Icons Pro Sign Up or whatever your experiment name is to continue setting up our experiment.

Now under the Objective for this experiment option select click on Select a metric then click on Goal Set 1 then select your goal, in our case IconsETC Order.

Percentage of traffic to experiment: We’re going to send 100% of traffic to the experiment. If your experiment is drastic and risky, you might want to include only a small proportion of your site's visitors.

Configure your experiment

Original Page: Here is where we define our original sign up page, there are two options, for us they’re as followed:

Web page to experiment:iconsetc.com/sign-up/

Name for the page:Original

Also, Enable the checkbox Consolidate experiment for other content reports, so that all the different pages of the experiment appear as one in the standard Google Analytics reports.

Variation 1: Here is where we define our first variation page there are two options, for us they’re as followed:

Web page to experiment:iconsetc.com/sign-up-2/

Name for the page:Risk Free

Click Next step.

Setting up your experiment code

How do you want to set up your experiment code?: Click Manually insert the code and insert the code directly under the opening <head> tag at the top of your original page only, in our case this page was iconsetc.com/sign-up/

After you’ve inserted the Google Analytics experiment code directly under the opening <head> tag click Next Step, Google Analytics will test and make sure the code was correctly inserted.

Note: If you’re using a CMS like WordPress for instance you may be using the same header.php for all your pages, in this case you’ll need to wrap the code in a PHP - If () Condition so that the Google Analytics experiment code only shows up on the page you want it to, we used the following code below, all we needed was the page ID for our original iconsetc.com/sign-up/ page

Goal Code: Remember the Goal we setup in Step 1 under the Objective for this experiment option? Again this is how the Google Analytics Content Experiments winner is chosen. So in our case we need to put the following code on our Order Conformation page just before the closing </head> tag, the page that the user is redirected to from PayPal after a successful payment, make sure that this code comes before your Google Analytics Tracking Code.

Again if you’re using a CMS like WordPress you may be using the same footer.php for all your pages, in this case you’ll need to wrap the code in a PHP - If () Condition so that the Goal code below only shows up on the Order Conformation page:

Review and start:

Final Thoughts

It may take up to 24 hours for Google Analytics to start tracking your experiment so don’t worry if you don’t see results right away. Also, no need to stop at just two variation pages, Google Analytics Content Experiments will allow you to run up to 9 page variations in one content experiment.