This code seems to work a lot better:
PHP Code:
if ($vbulletin->options['bbr_google_active']){
$bbrgoogleaccountid = $vbulletin->options['bbr_google_account_id'];
$bbrgooglecode = '<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push([\'_setAccount\', \''. $bbrgoogleaccountid .'\']);
_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\';
(document.getElementsByTagName(\'head\')[0] || document.getElementsByTagName(\'body\')[0]).appendChild(ga);
})();
</script>';
$BBR_find = '</head>';
$BBR_add_before = "$bbrgooglecode". PHP_EOL;
$output = str_replace($BBR_find,$BBR_add_before.$BBR_find, $output);
}
It uses the new Asynchronous Tracking script. More information about that is located here:
http://code.google.com/apis/analytic...cTracking.html
Check out
http://mmojunkie.com for a preview.