Preamble
Wikimedia Italia has its own Matomo instance since ~ December 2020 (see https://wiki.wikimedia.it/wiki/Matomo). This platform is useful to avoid Google Analytics while being still able to study the performances of https://www.wikimedia.it/ and other things and keep our fundraising officer happy with cute dashboard etc. That's just to say that Matomo is already adopted in Wikimedia Italia successfully to monitor some sites, and this Task talks about adding another website to this coverage.
This goal was proposed by our SEO company.
Success conditions
While it could be useful to add Matomo to https://wiki.wikimedia.it we should take care of some requirements:
- disable tracking code for special pages (e.g. check page id != -1)
- e.g. the login page should not be tracked in any way
- disable tracking code for registered users (e.g. check ! $user->isUserRegistered())
- disable tracking code for browser webs with DNT header enabled
- (what else?)
Available tools
MatomoOptOut Extension
https://gitlab.com/gruniversal/erwin/-/tree/master/src/extensions/MatomoOptOut
It seems a recent fork of the work from DaSchTour. It has an useful option to disable cookies from Matomo.
Proposed configuration:
wfLoadExtension( 'MatomoOptOut' ); $wgMatomoURL = 'https://matomo.wikimedia.it/matomo.php'; $wgMatomoJSFileURL = 'https://matomo.wikimedia.it/matomo.js'; $wgMatomoIDSite = TODO; // TO BE CREATED $wgMatomoDisableCookies = true; $wgMatomoIgnoreEditors = true;
Problem the repository says that the license is "CC-BY-NC" and this is a proprietary license. Moreover, this is a violation of the MediaWiki license. The correct license should be GNU GPL v2+.
MatomoExtension
https://github.com/DaSchTour/matomo-mediawiki-extension
It seems not actively maintained.