This should cover the steps to add Google Analytics to your PhpBB. I’m using the new analytics code that goes into the header instead of the footer as its supposed to catch more. ie The people leave your site before the entire page loads.
First goto your PhpBB directory and edit the following file (In the example I’m editing the prosilver style you will need to do it for all styles your using).
styles/prosilver/template/overall_header.html
Search for </head> and add the following just about it. Replacing UA-XXXXX-X with your code.
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-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>
Repeat for all the styles that you have active.
Once you have finished goto the General tab in your ADM setting and Run Purge Cache otherwise Google won’t be able to pick up the changes till your cache expires.
Now in Google Analytics settings hit Edit for the PhpBB3 domain. From there click on check status. It should tell you that “Analytics has been successfully installed and data is being gathered now” and its waiting for data.
OK that should be it for Analytics for PhpBB3
Comments.