Welcome to DirectoryRoll’s new blog. We hope to make this a good resource for directory owners and webmasters using directory for promoting there websites.
Installing Analytics on PHPLD Directory
Google analytics remains one of most used analytics tools that webmaster use to track visitor number, visitor behaviour and sometimes effect of marketing campaigns. Installing analytics on a directory would be as easy as logging on to Google Analytics account at https://www.google.com/analytics (You may create a new one if required).
Add a new domain and google will give you a code that should be put just before </body> tag in your footer.tpl (Location : phpldhome/templates/footer.tpl)
The code given by Google is javascript code and will look like this:
<script type=”text/javascript”>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “https://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-*********”);
pageTracker._trackPageview();
} catch(err) {}</script>
***** will be replaced by your tracking code.
However, when you install this code as it is by copying in your theme’s footer.tpl, you are in for a surprise, you will get an error related to var not being recognized.
To solve this just use {literal} and {/literal} delimiters around this code to make this work.
Happy tracking !
Note: These instructions have been tested on free version of PHPLD.
Tags: Google Analytics, Install, PHPLD, Problem, Smarty