I am trying to set a custom variable in my Google Analytics tracking for a very crude form of testing split.
The code that I use at the end of the 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 perfectly tracked, but I see nothing but "(not set)" in the "Custom section" in the "Visitors" section.
Can someone notice something wrong? I had this work before using old ga.js before asynchronous stuff came up.
Thanks.
source share