Extension:Matomo

This extension inserts your Piwik tracking code to the bottom of every page. It excludes the views of the users with 'bot' privileges (bots) and the 'protect' privileges (sysops).

It also adds a Special Page to some of the statistics.

Minimum requirements

 * MediaWiki 1.11+


 * A Piwik installation with your site configured

Installation instructions
Please, read them carefully. They're not very difficult to understand, but ALL steps are necessary:


 * Create a folder called "piwik" in your extensions directory


 * Upload Piwik.php, Piwiki.18n.php, Piwik_specialpage.php and piwik-mw.php to the "piwik" folder you've just created


 * Edit your LocalSettings.php and, at the end of the file, add the following:

require_once($IP.'/extensions/piwik/Piwik.php');

$wgPiwikURL = "http://piwik/url/"; $wgPiwikIDSite = "piwik_idsite";
 * Then, you need to define where Piwik is installed and the idsite. To do it, just add after the require_once:

Note: Change the value of $wgPiwikURL with the URL where you installed Piwik. Remember to add the trailing slash!

Change the value of $wgPiwikIDSite with the number inside piwik_idsite in your Piwik code. For example, in:

<a href="http://piwik.org" title="Web analytics" onclick="window.open(this.href);return(false);"> <script language="javascript" src="http://piwik/url/piwik.js" type="text/javascript"> <script type="text/javascript">

Web analytics <img src="http://piwik/url/piwik.php" style="border:0" alt="piwik"/> </a> the $wgPiwikIDSite is 1

$wgPiwikCustomJS = 'piwik_hosts_alias = ["hostname1.com", "hostname2.com"]; // the current tracked website is added to this array anyway piwik_install_tracker = 0;'
 * You can also set $wgPiwikCustomJS if you want to add custom javascript tags (see http://piwik.org/docs/javascript-tracking/ for further information). For example:


 * If you want to change piwik_action_name</tt>, you can set $wgPiwikActionName</tt> inside your LocalSettings.php file.
 * In case you want to include the piwik_action_name as, for example, wiki/Title of the page, you can set $wgPiwikUsePageTitle</tt> to true and set $wgPiwikActionName</tt> to "wiki/". The extension will print

piwik_action_name = 'wiki/Title of the page';

$wgGroupPermissions['usergroup']['viewpiwik'] = true; Where 'usergroup' is the name of the group. By default, only sysops can see the special page. If you want to allow bureaucrats to see the page, add that line with 'bureaucrat' where 'usergroup' is. The same is for normal users ('user') and anonymous users ('*').
 * Since 0.8 (1.0-RC3), you can choose which users can see the special pagesetting the following in LocalSettings.php</tt>.

For further installation instructions, check the README