Search This Blog

Tuesday, 13 July 2010

Adding Google Analytics to PHPBB


Create the profile as normal and past the code snippet into your :


/styles/<your_style>/template/overall_footer.html

Before the final /body tag


</table>
<br clear="all" />
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17416825-2']);
  _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>
</body>
</html>

If your using multiple styles then you'll need to update each .html file
Once done make sure your clear the forums cache in the Admin panel.