Extension:Google Analytics


 * For a better updated extension with more features, please see: Extension:Google Analytics Integration

Analytics is a simple extension which allows you to put a Google Analytics tracker in your MediaWiki articles, so you can obtain statistics on the articles that you are interested in.

Usage


Replace UA-17301139-1 with your own Google Analytics account number.

Source code
Source code of "extensions/analytics.php":

Add in LocalSettings.php

require_once("$IP/extensions/analytics.php");

Older Source code
This was the code for older Google Analytics installations, sometime pre-January 2007.

Source code of "extensions/analytics.php":

Async Tracking
This code has been tested on MediaWiki 1.19 and relies on the updated recommendations from Google (https://developers.google.com/analytics/devguides/collection/gajs/asyncTracking)

More info

 * See a live demo.
 * http://www.google.com/analytics/
 * It is possible to use Google Analytics in MediaWiki without tracking sysop users. However, you will need to modify the source code of your SkinTemplate.php file.  For more info:  http://www.pesme.net.
 * You can also track outbound links and direct file downloads (requires use of previous link) more info here.