I'm having trouble implementing Google Analytics Custom Variables on my site. The problem is that the bounce rate goes to zero when using them.
I'm using the asynchronous implementation and the split code version (http://code.google.com/apis/analytics/docs/tracking/asyncUsageGuide.html#SplitSnippet) to track the pageview. So, my code looks something like this:
<script type="text/javascript">
var _gaq_custom_variables = _gaq_custom_variables || [];
_gaq_custom_variables.push(['_setAccount', 'UA-22770314-1']);
</script>
<!-- rest of page content -->
<script type="text/javascript">
_gaq_custom_variables.push(['_setCustomVar',
1, // Slot
'Variable Name', // Variable name
'Value', // Variable value
3 // Scope.
]);
</script>
<script type="text/javascript">
_gaq_custom_variables.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = 'http://www.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
If anyone has been able to properly use Custom Variables avoiding this issue, I would really appreciate if you can point to a solution.
Thanks! JC