It was not too difficult to add Google Analytics. It requires two steps.
1) Create a file named analyticstracking.php and save it in the root directory with this content replacing the UA=xxxxxxx-x with your own tracking 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>2) Add this line near the top of your index.php file "require_once(dirname(__FILE__).'/analyticstracking.php');"
This is working for me but be forewarned that due to the require_once that if it cannot find the file, it may return a page error. There may be another way to code that to request_once or something similar but I don't know the optimal language here.
Cheers,
Nick