Logs: Add a Google Analytic tracking code to your Joomla website
In this article, we will show you how to add a Google Analytic tracking code to your Joomla website.
1) Log into the Joomla administration panel
2) Click the Template Manager link
4) Locate the template your site is using, then click on its title
5) Click the Edit main page template link
6) At the bottom of the code, locate the </body> tag and insert your tracking code above it
7) Click the Save & Close button
That’s it! You should start to see tracking results from this site within 24 hours on the Google Analytics panel
Kate January 14, 2014 at 11:04 am
We had a site made and now we must manage and handled it…we are all new to Joomla…
James Davey January 14, 2014 at 11:33 am
Hi Kate,
Joomla is actually pretty straightforward, though can be a little daunting. They actually have a large community support group at http://community.joomla.org/, and we can certainly try to help with any specific questions you may have, as well, if you contact our support team.
guy January 27, 2014 at 12:52 pm
Thanks for the help.
Akash February 12, 2014 at 11:49 pm
I am using joomla 3 and after clicking the template name it doesn’t show the “main page template” link. Please Help me
My website is : http://infogool.com
James Davey February 13, 2014 at 8:25 am
Hello Akash,
You should still have the option to edit the template, though it may be named differently. Alternatively, you can use FTP to do this, by downloading the index.php file that is in the templates/templatename folder (where templatename is the actual name of your template). Download the index.php file locally, then edit it in notepad. Add the analytics code right before the /body tag, and save the file.
Then, simply upload the index.php file to the same location, overwriting the one that is already there. It may be a good idea to have a backup of the unmodified index.php file saved, as well, just in case :)
Akash March 12, 2014 at 10:59 am
Thank You for your help. But after wasting my 1 month to setup my website using joomla, i came to know wordpress is too much easy and compatible to use.
BTW again Thanks For Your Help.
You can check my website again and see how optimized it is now, since it is still under construction. But i am very Happy that scripts like wordpress are here to help people like me.
Take a look : http://infogool.com
Elizabeth February 14, 2014 at 2:45 pm
I do not see the tag – we are using yoo cloud. Does that have a body tag?
Can I insert the tracking code at the bottom of of the page?
Do I than go and insert it on every page of the website? If so, where do I find those pages?
James Davey February 14, 2014 at 3:52 pm
Hello Elizabeth,
Every theme should have the body tag, as that is pretty standard for code on a website :) Are you editing the index.php file for the theme?
Elizabeth February 14, 2014 at 4:26 pm
Yes, I was editing the index.php file – thanks. For the template Yoo_Cloud I’m only getting the index page.
Should I try “Edit print view template”?
James Davey February 18, 2014 at 8:07 am
Hello Elizabeth,
That is strange. Can you open a ticket with our support team, via BackStage, so we can take a look at this for you?
Elizabeth February 18, 2014 at 11:21 am
Sure, how do I open a ticket?
James Davey February 18, 2014 at 12:03 pm
Hi Elizabeth,
If you login to BackStage, you should see a Support link there. You can open the ticket from that, and we’ll be more than happy to help :)
Elizabeth February 19, 2014 at 12:01 pm
James – thanks, got it!
Dog Runs Ireland March 30, 2014 at 10:02 pm
How to remove index.php from url in joomla 2.5
James Davey March 31, 2014 at 8:59 am
Hi there! That would be something you should be able to edit in the admin settings, or by using .htaccess
If you would like, we can take a look at this for you, but you may want to open a ticket in the helpdesk to get it done properly. You can open the ticket from within BackStage, using the support links there.
salman September 30, 2014 at 6:19 am
the same problem with me, i also want to solve this issue with my url
Charlotte July 9, 2014 at 3:18 am
Thanks for the advice – I have just paste the code into the template page as suggested. Currently I am not live with the website just yet and so cant check if it is working. Does pasting the code in once to the template page still track every page without me having to paste in to every page of my website?
James Davey July 9, 2014 at 7:10 am
Hi Charlotte,
Yes, that should track every page, as it is in the template file, which is used universally by Joomla.
Keith August 18, 2014 at 5:15 pm
Does Joomla have any plugins that can be installed to add analytics tracking? I am really confused how all this works.
James Davey August 19, 2014 at 6:53 am
Hello Keith,
I can’t say for certain, as we are not Joomla’s developers, nor do we develop modules for the software. I am sure there are some plugins out there, however, that will do this for you. I would recommend the Joomla forums to get started finding one.
Fredrick September 1, 2014 at 12:06 am
These instruction were really simple and easy to follow. I know there are plugins, but this method works well. Thanks for sharing!
salman September 30, 2014 at 6:17 am
i am using custom temple in joomla….
James Davey September 30, 2014 at 8:36 am
Hello Salman,
These steps should still apply. You would just have to work with yoru custom template rather than a pre-built one.
VISHNU December 13, 2014 at 3:09 am
Hello, i just placed the google analytics code in to my joomla website by opening index.php in template page but its not effecting to all the page. what is the problem is there any solutions? Please help me out.
Thanks in advance.
James Davey December 15, 2014 at 7:02 am
Hello Vishnu,
That is strange, and may be dependent on the template. Have you tested this in another template, to confirm?
Saifullah January 7, 2015 at 2:27 am
thnx really appreciated
TXC April 7, 2015 at 12:40 am
Thanks for your Great Post. I will consider all these things for my new blog. Thanks Again!
Becky April 24, 2015 at 2:23 pm
I do not have a “main page” link in my template.
Is this the same as index.php? There are no body tags in that file either.
James Davey April 27, 2015 at 5:39 am
Hi Becky,
Yes, the main page would be index.php. You would place the code anywhere, really – if there are no body tags, then simply place the code after the
sara August 3, 2015 at 2:32 am
m using histats but it’s not helpful for me at all
Corey Mahon August 4, 2015 at 8:51 am
Hi Sara,
Not a problem at all, Google Analytics should help you if histats isn’t. If you notice any problems getting these set up, please feel free to contact our support team by opening a ticket through your backstage panel and we’ll be glad to take a look!
Stavros Zacharias March 18, 2016 at 5:51 pm
Another approach:
1) Extensions –> Modules –> New –> Custom HTML
2) Toggle editor to no formatted text and paste your Google analytics code within ,
3) select any template position (any position will do since the script does not affect the DOM, but prefer one at the bottom of the template),
4) make sure at “Menu Assignment” that the module is assigned on all pages (it is by default), and
5) Save.
With this approach the code is not lost if the template gets upgraded.
The same if you change template where the new template has different position names. Just change the module’s position to one of the new template.
chinedu April 10, 2016 at 3:15 pm
Nice work here. Thank you.