September 4, 2006
Adding Google Analytics To MediaWiki
In order to add Analytics to MediaWiki, you first need the script code from Google. It should look something like this:
_uacct = "UA-XXXXX-X";
We need to insert the script code into MediaWiki so that it appears in every page generated. But where? In the MediaWiki's base skin php file. If you haven't changed the skin from the default, then you have the "MonoBook" skin. Edit the following file:
And insert the Google script code near the end of the file, just above the </body></html> tags. That's it. All pages will now execute the script.