The ROI Revolution Blog

Using Website Optimizer with Google Analytics NEW!!

May 12, 2008

gwo-ga.gif
You may remember that back in April of ’07, I came up with a way to get your Google Website Optimizer multivariate experiment data to show up in Google Analytics. While useful, there were a few drawbacks that I’m sure some of you have noticed, and it wasn’t the easiest thing to implement. After getting a lot of great feedback from users, I’ve come up with a new script that has many advantages over the old method:

  • Uses easier implementation
  • Works with both ga.js and urchin.js (make sure you use the right instructions below for Step 2)
  • Includes error-handling so that a JavaScript error no longer occurs if an experiment is not yet running or is paused, stopped, or completed
  • Features automatic page name tracking – no more changing the Google Analytics code on the page
  • No longer replaces regular page reporting

As a refresher, the whole point of this integration is to allow you to make the most of your experiments. While Google Website Optimizer by itself can give you a quick look at which combination is best at improving conversion, it tells you nothing about transactions, revenue, micro-conversions, navigation, segmentation by source, and bounce rate. If you integrate Google Analytics into your Google Website Optimizer experiments, you will get much richer data, and be able to get a true idea of how your test is doing.

Again, this integration is designed for multivariate experiments only – you do not need to use any special tools to be able to get A/B test data from Google Analytics.

The first thing to do is find out if you are using ga.js or urchin.js. Depending on which version of the Google Analytics code you are using, you’ll want to use different instructions.


Step 1: Upload the ga_gwo.js file to your server.

You can find this file here. Upload it to your server, and make a note of its location on your server, as you’ll need it in the next step. That’s it for Step 1!

Step 2: Paste the appropriate script onto your test page immediately after your existing Google Analytics code. There is one version of this for ga.js and another for urchin.js, so make sure you grab the right one!

If you are using ga.js, copy and paste the following code after your Google Analytics code:

You need to do three things to the script:

First, change the path to ga_gwo.js so that it points to the right location on your server.

Then, replace UA-XXXXXX-X with your Google Analytics account number.

Finally, change what’s inside getcombo_ga to match your experiment. The numbers inside will match the number of sections and variations (including the original) that are in your experiment. So if you are running an experiment with 2 headlines, 3 images, and 4 paragraphs, again including the original, you would call getcombo_ga(“2-3-4″);

You can find a working example of a page that’s using ga.js by viewing the source code of the page found here.

If you are using urchin.js, paste this code after your Google Analytics code instead:

You need to do two things to the script:

First, change the path to ga_gwo.js so that it points to the right location on your server.

Finally, change what’s inside getcombo_urchin to match your experiment. The numbers inside will match the number of sections and variations (including the original) that are in your experiment. So if you are running an experiment with 2 headlines, 3 images, and 4 paragraphs, again including the original, you would call getcombo_urchin(“2-3-4″);

You can find a working example of a page that’s using urchin.js by viewing the source code of the page found here.

That’s it! Now you’ll be tracking your combinations within Google Analytics!

Now, there are a few different ways you can go about seeing your data. I’d recommend excluding the test data from your main profile. You can do this by using a Custom Exclude Filter. Filter out any Request URIs that contain \?combo.

You can simply create a duplicate profile that doesn’t use this exclude filter.

Within your new profile, you would go to the Top Content report, where you can search for your test page by using the search bar on the bottom of the report. If you want to get more information about a specific combination, all you need to do is click on its name within the report.

Once you’ve clicked on a specific combination, you can then segment by a number of things. (As an aside, if you haven’t seen Jeremy’s cool Greasemonkey script for segmenting, you should definitely check it out!) Once you’ve segmented, you’ll have access to the Site Usage, Goal Conversion, Ecommerce, and (for AdWords) Clicks tabs. There you can find all kinds of information about Bounce Rate, alternative goals, and Ecommerce data. You can then use these more detailed metrics to get the full story concerning your Google Website Optimizer experiment!

So feel free to use this tool and please leave your feedback so that I can continue making improvements. Thanks for reading, and best of luck with your testing!

© 2002-2014 ROI Revolution, Inc. All rights reserved.