Thanks mate, I ended up doing it with a different script:
I THINK it's working now
<?php
/*
Plugin Name: MuchReviews Google Analytics Plugin
Plugin URI: http://muchreviews.com
Description: Adds a Google analytics tracking code to the <head> of your theme, by hooking to wp_head.
Author: Alex
Version: 1.1
*/
add_action( 'wp_head', 'MuchReviews_GoogleAnalytics' );
function MuchReviews_GoogleAnalytics() {
$analytics = "<script type='text/javascript'>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX 1']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_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>";
echo $analytics;
}
I THINK it's working now
