I have been trying to setup a custom variable for the past few days and it hasn't been working.
My Google tracking code is part of a master page (asp.net concept) so I can't set the custom variable inside the second script block labeled "Async Google Code" because it is shared by many other sections.
Below is my code and the order it appears in my page. Is there any way I can set it outside the "Async Google Code" script?
<head>
<!-- Setting Custom Var -->
<script type="text/javascript">
$(function () {
_gaq.push(['_setCustomVar', 1, 'Account', 'UserType', 2]);
}
</script>
<!-- Async Google Code -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
_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);
})();
</script>
</head>