This extension allows you to seamlessly integrate Google Tag Manager into your MediaWiki website.
-
Clone this repository inside your
extensions/
directory.cd extensions/ git clone https://github.com/gboyers/MediaWiki-GoogleTagManager.git GoogleTagManager
-
Add the following code to your
LocalSettings.php
:wfLoadExtension('GoogleTagManager'); $wgGoogleTagManagerID = 'GTM-XXXXXX'; // Replace with your actual Google Tag Manager ID
-
Navigate to
Special:Version
on your wiki to verify the extension is successfully installed.
$wgGoogleTagManagerID
: Set this configuration variable to your Google Tag Manager container ID.
Once installed and configured, the Google Tag Manager script will be automatically embedded into the pages of your MediaWiki site. You can then utilise the Google Tag Manager dashboard to manage your tags, triggers, and variables.
Contributions to this extension are warmly welcomed! If you encounter any issues or have suggestions for improvements, please submit them to the GitHub repository's issues page.
This extension is licensed under GPL-3.0-or-later.