Updated for Joomla 4

This plugin has been updated for the latest version of Joomla!, Joomla 4.


Normally we would embed the Google Analytics tracking code in to the template of each of the sites that we are build. In some circumstances we'd find that the end user would want more control over the Google Analytics code and would prefer to switch it on and off or insert new tracking code at their own will. So we've compiled this little plugin that allows for just that.

This new updated version of the plugin allows for the implementation of Google Analytics in all three methods that have been known over the years from, asynchronous, universal and the new gtag methods. It is advised that you use the latest gtag method.

Google Analytics for Joomla

This plugin now has a pro version that allows you to fine tune your Google Analytics configuration.

This plug-in allows you to simple add in the tracking ID supplied by Google in your analytic account in to its parameters. (e.g. UA-XXXXX-X).

Find out how to identify your Google Analytics Tracking ID.

It does not track the administrator area of your site and embeds the required Javascript the way that Google recommends, just before the closing tag. Simple install the plug-in, add in the tracking code in to the parameters and enable the plug-in.

To read more about the legacy asynchronous method of embedding Google Analytics please refer to the Google documentation.

The plugin now uses the new gtag method from Google. You can read more about the gtag from the official Gtag Google Documentation.

You can also use this plugin to implement Google Tag Manager to your website and use it to implement Google Analytics.

Find out more at our Niche Extensions website.

Version 5.0.0 (7 September 2020)

– Complete rebuild using Google Site Tag method. Asynchronous and universal methods now removed as Google no longer can guarantee it will work. – Optimised code – Features, webmaster tools verification, Google Analytics and Google Tag Manager implementations – New update server

Version 4.6.4 FREE (29 May 2017)

– Clean up code and checked for PHP 7.1.x compatibility

Version 4.5 FREE (10 February 2015)

– Optimised code output – Optimised the functions itself to under 100 lines of code

Version 4.5.1 (13 December 2014)

– Added enhanced in-page analytics for Universal analytics – Code clean up a

Version 4.3 (14 September)

– Added new direct download URL and update URL for future updates. – Allows you to install Google Analytics via the Joomla admin area

Version 4.3 (13 May 2014)

– Updated for Universal Google Analytics Display Marketing/Remarketing feature

Version 4.2

– Added Google Analytics conversion tracking

Version 4.1 (22 March 2013)

– We have completely rewritten the plugin to work better and be more optimised for the new Universal Google Analytics. – You now have the option of choosing between the older Asynchronous Google Analytics or using, the newer Universal Google Analytics.

Version 3.0

We've gone simple. This new version of the Google Analytics plugin has now gone simple!

We'll be releasing a pro version soon that will have all of the advanced features. Of course you can still download the older version in the 2.5.7 series to get some of those advanced feature but all the new goodies will be in version 3.

Version 3 has been updated to work with an auto updater and also with the web installer found in Joomla 3.2.

You can download version 3.0 now ready for Joomla 3 and Joomla 2.5.


After all the advanced features? Go Pro!

If you're after all the advanced features where you can fine tune how Google Analytics works, the subscribe for a PRO subscription to the plugin for only $4.95 (Less than a beer in many countires).

Older Versions

For the latest updates check the Niche Extensions website.


Version 2.5.6 – 1st August 2012 Two new features

Added new features:

  • Anonymous IP tracking to comply with German privacy laws
  • Option to place code output at the end of the output or at the bottom of the page before the closing tag.

Version 2.5.5 – 1st August 2012 No more new updates for J1.5

I'm going to stop updating the Joomla 1.5 version from here on in. As Joomla 1.5 is coming to end of life in September I won't be developing for it anymore. The Joomla 1.5 version will still be downloadable as is for usage but won't have any more new features.

Version 2.5.4 – 16th Feb 2012 Bug Fixes

Bug fixed with sample rate overriding site speed variable. Also note that site speed has a max value of 10.

Version 2.5.3 – 15th Feb 2012 New Advanced Features

  • Subdomain and Multiple top level domains New support has been added to the plugin. It now supports multiple sub domains and multiple top level domains. e.g. example.com.au, example.com, example.co.uk
  • Sample rate specifications Session timeout is used to compute visits, since a visit ends after 30 minutes of browser inactivity or upon browser exit. If you want to change the definition of a ‘session' for your particular needs, you can pass in the number of milliseconds to define a new value. This will impact the Visits reports in every section where the number of visits are calculated, and where visits are used in computing other values. For example, the number of visits will increase if you shorten the session timeout, and will decrease if you increase the session timeout. You can change the expiration timeout to 0 to indicate that this cookie should be deleted when the browser is closed.
  • Site speed sample rate specification Maximum setting of 10. By default, a fixed 1% sampling of your site visitors make up the data pool from which the Site Speed metrics are derived. If you have a relatively small number of daily visitors to your site, such as 100,000 or fewer, you might want to adjust the sampling to a larger rate. This will provide increased granularity for page load time and other Site Speed metrics.
  • Visitor cookie timeout Sets the Google Analytics visitor cookie expiration in milliseconds. By default, the visitor cookie is set to expire in 2 years. If you prefer, you can change the expiration date of the visitor cookie using this method. You can change the expiration timeout to 0 to indicate that this cookie should be deleted when the browser is closed.
  • Social Media Tracking Allowing for the tracking of Facebook ‘like' and ‘unlikes' as well as Twitter actions for websites that have Facebook and Twitter integrated into their templates or website.
  • Tracking Differentiation Between Front End Logged in User and Frontend Visitor Adding in the extra code required to track website members actions compared to that of website visitors.
  • Google Webmaster tools domain verification

Version 2.5.2 – 9th Feb 2012 – New Features – Multi Tracking

Addition of multi top level domain tracking and addition of multi sub domain tracking.

Version 2.5.1 – 8th Feb 2012 – Update for Joomla 2.5

Updated the plugin to work with Joomla 1.5 – 2.5. Changed the versioning to match the latest Joomla version as well.

Download the Plug-In

Niche Extensions

Download from Niche Extensions

Please make sure you download and install the right version for your Joomla instance as installing the J1.5 version on J1.6 / J1.7 will break your site.

If you use this plugin, leave a comment and please post a rating and a review at the Joomla! Extensions Directory.