The Next Generation of Visual Website Optimizer is launching in April 2014 See What's Coming

Say hello to Google Analytics plugin for Visual Website Optimizer

Posted in News on February 9th, 2010

Visual Website Optimizer’s integration with Google Analytics is automatic, which means you don’t have to modify your existing GA or VWO only in anyway. While creating a test, simply enable this integration option with the click of a button. What this integration does is that it pushes VWO variation data into GA’s custom variable report, so you can segment any report in GA with an additional segmenting option. Once you enable the option in test settings (under accounts) or during creating a test, Visual Website Optimizer will automatically pass the variation data of the Variations to the Google Analytics.

 

To see A/B test reports in Google Analytics, click on Visitors in the sidebar and then click on Custom Variables report. Then click on the test id (available from VWO reports page) corresponding to the test you want to see a report for. An example of the report name in GA would be “VWO-2” which means it is a report corresponding to test with id 2 (test id is visible in the test details section your VWO reports). In the report you can see goal values for different variations plus you can also see different metrics such as bounce rate, time on site, return visit, pages/visit, etc. corresponding to the variations. The reports look something like the following screenshot (click to expand):

In the integration options, there are two values that you can change:

  • GA Slot: This is the custom variable slot in Google Analytics that you want to use for Visual Website Optimizer. If you are unsure what this means, leave it as it is.
  • GA Account Prefix: In case you are using more than one Google Analytics account on your website, specify here which Google Analytics Account Prefix you want VWO to be integrated with. This is an optional field and should be left empty if you are unsure. Please read more about it on our helpbase.

 

<< The following method is now deprecated, although still supported >>

For integrating Google Analytics with Visual Website Optimizer, you will have to sandwich a snippet of code (in bold font below) in your existing Google Analytics tracking code (most likely present at the bottom of your website HTML):

<script type=”text/javascript”> var pageTracker = _gat._getTracker(“XX-XXXXXX-X”); pageTracker._initData(); if (typeof(_vis_opt_GA_track) == “function”) { _vis_opt_GA_track(); } pageTracker._trackPageview(); </script>

The process for Asynchronous code snippet is similar:

_gaq.push(['_setAccount', 'XX-XXXXXX-X']); if(typeof(_vis_opt_GA_track) == “function”) { _vis_opt_GA_track(); } _gaq.push(['_trackPageview']);

In other words, the code in bold (javascript function  _vis_opt_GA_track()) needs to be added just before the Google Analytics code snippet _trackPageview After you have added the code, the integration is done. No more settings, no more configuration. For all tests, the Google Analytics intergration will start automatically. Before you get too excited, please note following important points regarding the plugin:

  • By default, the plugin will work perfectly ONLY if you have one test running on your website running at a time (the limitation is because Google Analytics provides limited slots to store customer variables). In order to track multiple tests simultaneously, see the technical note below.
  • The reports you see in Google Analytics are indicative, at best. GA won’t show you statistical significance for any result – so interpret the results with care.
  • Unlike VWO, Google Analytics reports aren’t realtime – so allow atleast 1-2 days for data to show up in GA reports.
  • You can add the integration code site-wide (even on the pages where VWO is not running). The plugin will not affect your GA tracking in any manner.

Technical note: VWO uses GA’s 4th custom variable slot by default. If you would like to change it (either because you already use if for a different purpose or you want to track multiple tests in GA), add the following code before any GA code:

<script type=”text/javascript”> var _vis_opt_GA_slot = YOUR_CUSTOM_SLOT; // a number between 1-5 </script>

Leave a comment here if you cannot get the plugin to work for you or you have trouble understanding what code to add or where to add. This manual integration does not work with Visual Website Optimizer’s asynchronous code aspect.

Paras Chopra

CEO and Founder of Wingify by the day, startups, marketing and analytics enthusiast by the afternoon, and a nihilist philosopher/writer by the evening!

The Complete A/B Testing Guide

Know all that you need to get started:

  • What is A/B Testing?
  • Is it compatible with SEO?
  • How to start your first A/B test?
Show Me The Guide


Tags

46 Comments
David Crowther
March 3, 2010

Is it possible to create a version of this for Clicky analytics (http://www.getclicky.com)

~ David

Paras Chopra
March 4, 2010

Hey David, I can help you with the integration if you want.

-Paras

David Crowther
March 5, 2010

Thanks Paras. It’s on my task list.

André Scholten
April 13, 2010

Which of the 5 slots do you use? Can we configure that?

Paras Chopra
April 13, 2010

VWO uses slot 4. Currently it isn’t possible to customize that but would you like to do it?

André Scholten
April 13, 2010

Well, sometimes we use something like gaTracker instead of pageTracker, and sometimes we use the async version of the Google Analytics tracking code. And some clients already use slot 1 to 4, and then it’s good to have a choice.

Paras Chopra
April 13, 2010

Great idea, we can easily build that feature into the integration code. Let us know when you are on it.

[...] integration with Google Analytics, Omniture SiteCatalyst and other analytics packages will let you track performance of variations on [...]

Jacob Kildebogaard
April 28, 2010

Hi Paras

Just want to say that this is a killer integration. Reeeaaaally love this.

The option of choosing slot yourself would be real great, it makes it much more flexible. And would make it possible to track 5 different test on the same site at a time. That is relevant when having 5 landingpages with its own order flow :)

Paras Chopra
April 28, 2010

Hi Jacob,

Yes, in the next version (coming out this week) we will be providing a code snippet that allows specifying which slot to use. Stay tuned!

-Paras

Paras Chopra
April 29, 2010

To all who requested GA custom slot, updated the code and post to allow that!

Vincent
June 1, 2010

Hi,

We’re using Google Analytics asynchronous tag.
Is the integration of VWO will be the same as the code you show upon?

Example:

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxx-x']);

if (typeof(_vis_opt_GA_track) == “function”) { _vis_opt_GA_track(); }

_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();

Thanks

Paras Chopra
June 1, 2010

No, it won’t be the same. Just wait a couple of days – we are releasing a plugin compatible with Async code.

Lachlan Donald
June 2, 2010

Paras,

Any reason why this doesn’t work?

if (typeof(_vis_opt_GA_track) == “function”) {
var pageTracker =
_gaq._createAsyncTracker(analyticsCode, ‘pageTracker’);
_vis_opt_GA_track();
}

Paras Chopra
June 2, 2010

The code doesn’t yet work with asynchronous GA snippet. We will be soon updating the VWO code to make it work. Will keep you informed.

Paras Chopra
June 3, 2010

UPDATE: It is now possible to use VWO plugin with GA asynchronous code snippet. See the update in the post.

Luke Stevens
June 11, 2010

Hey Paras, just stumbled across this the other day — apparently it is possible to have more than 5 custom variables: http://analyticsimpact.com/2010/05/24/get-more-than-5-custom-variables-in-google-analytics/

fwiw.

Alex Nghiem
August 10, 2010

Paras:

Do you have a plug-in that works with getclicky.com now?

Thanks,

- Alex -

Paras Chopra
August 10, 2010

No, not yet. Are you looking forward to that?

Alex Nghiem
August 23, 2010

Paras:

Yes, I need integration with GetClicky.com

Even if there isn’t a plug-in, is it possible to use your tool with GetClicky?

Thanks,

- Alex -

Paras Chopra
August 23, 2010

Alex, yes of course, you can use it with Clicky. There will be no conflicts.

Simon
September 10, 2010

How is suggested that it’s implemented if using the format:

var _gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-XXXXXX-1'],['_trackPageview'],['b._setAccount', 'UA-XXXXXX-2'],['b._trackPageview']);

Paras Chopra
September 10, 2010

@Simon: you can call _vis_opt_GA_track() function immediately after var _gaq = _gaq || []; Something like this:

var _gaq = _gaq || []; if (typeof(_vis_opt_GA_track) == “function”) { _vis_opt_GA_track(); } _gaq.push(['_setAccount', 'UA-XXXXXX-1'],['_trackPageview'],['b._setAccount', 'UA-XXXXXX-2'],['b._trackPageview']);

Let me know if it helps

Simon
September 10, 2010

Thanks Paras, worked a treat, in that there are no errors. Looking forward to seeing the results in GA!

Nick Winter
September 22, 2010

Is there a known issue with _vis_opt_GA_track() causing visits to become treated as new visits (and thus jacking the bounce rate up to 100%)? This is really mauling our Analytics data. I’m guessing it’s some weird interaction with our setup, because third-party Analytics integration has done this in the past before, but I have no idea how to debug it.

The difference between our setup and yours is that we don’t have an _initData() line–is that necessary? http://www.google.com/support/forum/p/Google%20Analytics/thread?tid=6ae93fabba94b5fd&hl=en

david carruthers
December 16, 2010

I don’t understand how I track multiple tests – sorry! Do I simply add that code snippet at the top of every page to change it to ’5′?

Paras Chopra
December 16, 2010

@David: change what to ’5′? Can you email us at support@wingify.com?

John
December 18, 2010

Hi Paras

We use Urchin Server, and it does not support custom variables only the User Defined Variable. Do you have a setting that will allow us to specify that the test group label be applied to the User Defined Var? Also, it seems that it would be simpler to use a single variable to label a visit regardless of the test participation (assuming that each visitor is limited to only a single test). Given that, could we just set the variable value with this structure “test name: test group”. That way, we don’t have to constrain GA/Urchin tracking of our active tests to the whatever the availability of multiple unique variables “slots.”

Thanks always for sharing your ideas so freely and moving your platform forward with such agility for all of us to benefit.

Paras Chopra
December 18, 2010

@Hi John, why don’t you mail me and then we take from there?

Marco Gomes
February 3, 2011

This is not the code that I have on my website for Google Analytics. The code I have is

_uacct = “NNNNNNNNNNNN”;
urchinTracker();

Can you please help me get this up and running?

Paras Chopra
February 3, 2011

@Marco: can you email at support@wingify.com

Yossy
February 9, 2011

If I use the funtion:
pageTracker._trackPageview(“XXX.html”);

The pluging will work?

Paras Chopra
February 9, 2011

@Yossy: yes it should.

Prashant Sharma
May 11, 2011

Hello PARAS,
I am not able to add your given code in our website because so please let me know if you can do it

PS we are using Google analytical right now

[...] is Visual Website Optimizer. After implementing this tool, the only thing left to do is report back to the Funnel Analysis tool with the test name and variation for each [...]

[...] One of the Visual Website Optimizer users, Jason Thompson did a great job in integrating VWO with Omniture SiteCatalyst. (We already have a Google Analytics plugin). [...]

Anne Stahl
June 9, 2011

Can you please add this page/content to the help section? I keep trying to search for it and don’t find it.

Paras Chopra
June 9, 2011

@Anne: Thanks for pointing it out. Just adding the article.

Zorg John
November 4, 2011

Is it in the near future going to be possible to run multiple tests at the same time?

Paras Chopra
November 5, 2011

@Zorg: yes, we are planning to update the snippet to allow for multiple tests.

Kevin
December 14, 2011

Am I reading this correctly? I have a multiple URL based tests running on my site for a template test across course pages.

I also have a goal page tracking in the test. The goal is picked up by VWO, but I’m not seeing the goal tracking in GA. Is this because I have 29 individual tests for the course template split test and GA will only show the goal results if there is one test running?

The plugin is working for other queries. All 29 tests are on Custom Var 4.

Vasil
January 4, 2012

This is great feature!
But looks like it doesn’t work with async VWO code. In async VWO snippet, the javascript contanining the “_vis_opt_GA_track()” is loaded AFTER Google Analytics sends a beacon. So the code that should set GA custom variable is skipped. As a result, we don’t have integration.
The solution is using synchronous snippet, but I still hope this can be resolved somehow (e.g. by ordering calls to VWO and GA scripts).

Paras Chopra
January 4, 2012

@Vasil: yes, we do have plans to make GA async work with GA script.

Edit: The GA async integration now works perfectly.

Vasil
January 4, 2012

It’d be very nice. Anyway, I think you should mention using synchronous VWO snippet for Google Analytics integration in this post. It can save time of other people who can step on the same rake :)

[...] into Google Analytics (as shown by the marvelous way Visual Website Optimizer allows you to track and segment tests within the GA interface). Just make sure not to breach the terms of service, [...]

[...] into Google Analytics (as shown by the marvelous way Visual Website Optimizer allows you to track and segment tests within the GA interface). Just make sure not to breach the terms of service, [...]

Leave a comment
Required
Required - not published


six × 3 =

Notify me of followup comments via e-mail.

RSS feed for comments on this post. TrackBack URL

I ♥ Split Testing Blog


Stay up to date

Recent Posts

Write for this blog!

We accept high quality articles related to A/B testing and online marketing. Send your proposals to contribute@wingify.com