I've been using Piwik for over a year and hadn't written an article about it yet. This is the opportunity to show you this equivalent to Google Analytics.
Prerequisites
Set up a database on a MySQL instance that you'll use during the installation.
server{includelisten_port.conf;listen443ssl;ssl_certificate/etc/nginx/ssl/deimos.fr/server-unified.crt;ssl_certificate_key/etc/nginx/ssl/deimos.fr/server.key;ssl_session_timeout5m;server_namepiwik.deimos.fr;root/usr/share/nginx/www/deimos.fr/piwik;indexindex.php;access_log/var/log/nginx/piwik.deimos.fr_access.log;error_log/var/log/nginx/piwik.deimos.fr_error.log;# Drop configincludedrop.conf;location/{try_files$uri$uri//index.php?$args;}location~\.php${fastcgi_cachemycache;fastcgi_cache_key$request_method$host$request_uri;fastcgi_cache_validany1h;includefastcgi_params;fastcgi_passunix:/var/run/php5-fpm.sock;fastcgi_intercept_errorson;}location~*\.(js|css|png|jpg|jpeg|gif|ico)${expiresmax;log_not_foundoff;}}
Piwik
We'll create a cron job to optimize Piwik's performance:
Once the crontab is added, we'll configure the web interface to stop automatically processing data when accessing a report. Go to:
Settings > General Settings tab
Let Piwik archiving trigger when reports are viewed from a browser: No
Reports for today (or any date range including today) will be processed at most every: 3600 seconds
The Piwik configuration is now complete. You need to add sites and configure them to send stats to Piwik.
MediaWiki
Piwik is an equivalent of Google Analytics, but free. It enables you to have statistics for your website with nice graphs etc. There is a plugin that allows you to insert code in each page (necessary), but it's obsolete and has security vulnerabilities. We'll use another module that will simply allow us to insert this type of code.
You need to install the PCR GUI Inserts module which allows you to insert information at various locations on your pages. First, activate the extension by adding these lines: