Extension:GTag

The GTag extension lets you insert the new Google Analytics tracking tag on your MediaWiki site ("gtag.js").

Download
This extension can be downloaded as a .tar.gz file, here (you must first register on mwusers.org in order to download the file).

You can also download the extension via Git from its GitHub repository, by calling the following:

Configuration parameters

 * $wgGTagAnalyticsId (string)
 * Google Analytics id, required.


 * $wgGTagAnonymizeIP (boolean, default false)
 * If true, anonymize the IP address sent to Google Analytics.


 * $wgGTagEnableTCF (boolean, default false)
 * If true, support the IAB Transparency & Consent Framework used by many 3rd party cookie consent widgets. You will need to implement such a widget yourself into your wiki; the extension does not come with one.


 * $wgGTagHonorDNT (boolean, default true)
 * If true, honor "Do Not Track" requests from browsers. If false, ignore such requests.


 * $wgGTagTrackSensitivePages (boolean, default true)
 * If true, insert tracking code into sensitive pages such as Special:UserLogin and Special:Preferences. If false, no tracking code is added to these pages.

User rights

 * gtag-exempt
 * Users granted this right will not be tracked by Google Analytics. This can be useful to exempt staff groups from being tracked, to get a better idea of what your end users are doing on the wiki.