Add Google Analytics to Pligg
July 24th, 20081. Open up footer.tpl from your template directory, Find :
<div class=”footer”>
Powered By <a href=”http://www.pligg.com/”>Pligg</a> | Legal: <a href=”http://www.affero.org/oagpl.html”>License</a> and <a href=”https://sourceforge.net/project/showfiles.php?group_id=176676″>Source</a>
</div>
2. Just below that add a new line and enter this date:
<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(”xx-xxxxxx-x”);
pageTracker._initData();
pageTracker._trackPageview();
</script>
Some person would say that you can add the Google Analytics code into header.tpl, but I am not agree that because put it in footer.tpl will make your webpage loading faster.