How to add Google Analytics

Before VBulletin 4, the Google Analytics code was pasted before the </body> tag in the footer. With VBulletin 4, there is no </body> tag in the footer and placing the code gives an error. Where do you put the code then? The solution is simple. Just add the code in the bottom of footer between <vb:literal> tags. It should look like this:

<vb:literal>
<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">
try {
var pageTracker = _gat._getTracker("UA-xxxxxxx-xx");
pageTracker._trackPageview();
} catch(err) {}</script>
</vb:literal>
 

That's it, now you have succesfully installed Google Analytics on your VBulletin 4

Subscribe / Share

993ti tagged this post with: Read 110 articles by

Honda Z50 deals on Ebay

RSS Latest cars for sale