InMotion Hosting Support Center

Google Analtyics is a great tool you can use in conjunction with Joomla 2.5 to help track all of the traffic that your website receives. It is free to setup and use Google Analtyics, and this guide will walk you through the necessary installation steps. Because Google Analytics is an industry standard, there are many tutorial available online to help you with using this tool to monitor visits to your Joomla 2.5 website.

Installing Google Analtyics for Joomla 2.5

  1. Create a Google Analytics account

    If you haven't already, you will need to sign up for a Google Analtyics account. Visit this page and then click the Create an account link in the top right of the page.
  2. Generate Tracking Code

    Once you're logged into Google Analtyics, your next step is to setup your Joomla 2.5 website within the tool and get the tracking code. Here are the general steps (again, you must be logged in to Google Analytics first)

    - Click Admin in the top right menu
    - Click the New Account Button
    - Fill out all the details on the Create New Account page and then click the Create Account button at the bottom of the page
    - You will then be on a page with several tabs at the top, and the current one selected is Tracking Code. Find and copy into a text editor (for later use) the code under section 2. Paste this code on your site. It will look similar to the following:

    Example CodeScreenshot
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-33230672-1']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  3. Paste the code in your template

    The instructions from Google say to paste the above tracking code right before the closing of your </head> tag. What you'll need to do is edit your Joomla 2.5 template and add this code before the closing </head> tag. When testing these steps with the Beez_20 template, on the Template Manager: Cusomise Template page we clicked the Edit main page template link under Template Master Files.


    On this page, we can then add our tracking code. As you can see in the screenshot below, we added the tracking code right before the </head> tag:


    Be sure to click Save in the top right of the page to save the changes to your template.
  4. Verify the tracking code has been added

    When you go back to your Google Analytics account, back to the same page that gave you the tracking code, refresh the page. If the tracking code was installed successfully, next to Tracking Status you should see a Tracking Installed message.

Congratulations, you have successfully installed the Google Analytics tracking code to your Joomla 2.5 website! If you had any problems with this process, we're happy to help if you post a question in our community support page.

Continued Education in Course Joomla 2.5
You are viewing Section 8: 309: Adding Google Analytics to Joomla 2.5
Section 7: 308: How to create a Joomla 2.5 Blog
Section 9: 310: Removing and Reinstalling extensions in Joomla 2.5

Joomla Community Google+ Hangout #3

June 3rd, 2014

Thank you @RustyJoomla for letting me speak on the Joomla Community Google+ Hangout!

Click here to watch!

Support Center Login

Social Media Login

Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2015-04-12 8:43 am

What to do if I don't have a "head" inside this place?

this is what I have


<?php/*** @package   yoo_master2* @author    YOOtheme* @copyright Copyright (C) YOOtheme GmbH* @license GNU/GPL*/// no direct accessdefined('_JEXEC') or die('Restricted access');// get warp$warp = require(__DIR__.'/warp.php');// load main theme file, located in /layouts/theme.phpecho $warp['template']->render('theme');

31,565 Points
2015-04-13 11:51 am
Hello Avital,

Are you saying that following the above steps you only see the code you just provided? There should be a head section in the page.

Kindest Regards,
Scott M

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

2 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!