Theme Joomla Tips and Advice

How To Add Google Analytics to your Joomla Site

Google Analytics (GA for short) is a free service offered by Google that generates detailed statistics about the visitors to a website. This article explains how to add Google Analytics to Joomla 1.5 (if you want to see the video demo, click here)

  • Click on the Google Analytics Homepage. 
  • Login in to your analytics account and get the tracking code for tracking your site. This is the code you get given in Google Analytics for monitoring your site - it should look something like this:
 
<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("YOUR TRACKER CODE HERE");
pageTracker._initData();
pageTracker._trackPageview();
</script>
  • You can copy this code into your Joomla! website. Their are many ways to go about this, for example you can create a module and copy the code into the module (but this can cause issues as some WYSIWYG editors will strip and alter the code, and it can not work) alternatively you can open your templates index.php file and paste the code in directly. This can be done by editing this file in your Joomla backend (Joomla 1.5) or editing the file directly and then uploading via FTP.

How to edit via template admin backend For Joomla 1.5:

  • Login to Joomla administrator backend account.
  • go to menu Extension >> Template Manager
  • click on your default template >> Edit HTML
  • paste your Google Analytics tracking code right before </body> tag
  • then click on save.

It's a easy as that - just a few simple steps and you will be able to track your website traffic and stats!

members

search