Jump to content


Tutorial info

  • Added on: Apr 15 2011 03:07 PM
  • Views: 2675


* * * * *
0 Ratings

How to Add Google Analytics to IPB 3

Adding Google Analytics to IP.Board 3 in a few easy steps.

Posted by EchelonOne on Apr 15 2011 03:07 PM
The Google Analytics javascript was changed recently, and now allow it to be entered within the HEAD tags, this gives better results when your visitors do not let the page load fully. The old way gave too many false/positive results which is why the code was updated accordingly.

To add this code to IP.Board so it is picked up globally across your forum it needs to be placed within the head tags, so this short tutorial will show you exactly how to do this. Make sure you have your Google Analytic code ready because it is very easy to add.

Login to your ACP -> Look & Feel tab -> Click on the skin you are using as your default. Under Templates > Global Templates click on globalTemplate.

In this template find the following code:
	</head>

	<body id='ipboard_body'>

		<div id='ipbwrapper'>
Directly before this code paste in your Google Analytics code. Here's an example of the code, you will noticed we have added <!-- Google Analytics --> to the start and end of the code, these are just to make life easier when looking for code in templates, these lines of code are not in anyway shown they are classed as comments and ignored by browsers.

<!-- Google Analytics -->
<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>
<!-- End Google Analytics -->

Once you have pasted this code in place then just click Save and now your pages will start to be tracked within 24 hours by Google Analytics.
Powered by Tutorials 1.3.1 © 2012, by Michael McCune