Hello,
I'm trying to set a custom variable in my Google Analytics tracking for a very rough form of split testing.
The code I'm using at the end of my 'head' section is
var _gaq = _gaq || [];
_gaq.push(
['_setAccount', 'UA-xxxxxx-xx'],
['_setCustomVar', 1, 'split', '1', 2],
['_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);
})();
The page view is tracking fine but I'm not seeing anything other than "(not set)" under the User-defined sub-section of the Visitors section.
Can anyone spot anything wrong? I've had this working before using the older ga.js before the Asynchronous stuff came along.
Thanks.