Adding Google Analytics to Plone 3
IMPORTANT: This article was written in Aprile 2008, since then new script is provided by google. All installations should use the new script.
Not that this site is ever expected to see any real traffic, I added Google Analytics as an exercise. I would rate this as being very easy to do.
Google provides very verbose installation instructions. It's not any harder than logging into a google account, going to the Google Analytics site, and entering the URL of your site. The Google Analytics install even verifies that the script (below) has been inserted correctly.
Plone
Insert the Google supplied sample script into the Plone 'Site settings'
The script is:
<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-4247589-1"); pageTracker._initData(); pageTracker._trackPageview(); </script>
Empty Analytics
Once it was setup, there was a dashboard ready to go (and waiting for traffic).
Links