Generating Website Statistics With Piwik, An Open-Source, Google Analytics-Like Web Analytics Tool - Page 2

Now fill in a user name for the Piwik administrator (e.g. admin), a password for that user, and the email address of that user. This is the username and password that you'll need later on to log into Piwik:

You can configure Piwik to generate reports for multiple web sites later on, but during the installation, we configure Piwik for our first (and maybe only?) web site. Fill in a name for that web site and its URL:

Afterwards, Piwik will display a Javascript code for that web site. Copy it and paste it right above the </body> tag of all pages belonging to the web site that you've configured in the last screen (

Click on Next afterwards:

The installation is now finished. Click on Continue to Piwik:


3 Using Piwik

Now log in with the account you've created during the installation:

This is the Piwik Dashboard (in my example it's quite empty, but on a real-life system, you should see quite a lot statistics after some time):

You can manage Piwik by clicking on the Settings link in the upper right corner. Here you can enable or disable Piwik plugins,...

..., manage users and access permissions,...

... and add further web sites (you will get a unique Javascript code for each web site):


4 High-Traffic Web Sites

The Piwik reports are generated in real-time which can make the Piwik web interface a little bit slow on high-traffic web sites. Therefore you should set up a cron job (as described on that generates the reports once a day - the Piwik interface should then react faster again:

crontab -e
MAILTO="[email protected]"
5 0 * * * www-data /var/www/

(This generates the reports each day at 00:05h. Make sure you use the correct user name for the web server. On Debian/Ubuntu, it's www-data, on Fedora/CentOS, it's apache.)

Make the /var/www/ file executable:

chmod 755 /var/www/

Then run it manually to see if it throws any errors:


If you see something like this...

[[email protected] cron]# /var/www/
/var/www/ line 20: /usr/bin/php5: No such file or directory
[[email protected] cron]#

... run...

which php

... to find out where PHP is located...

[[email protected] cron]# which php
[[email protected] cron]#

... and edit /var/www/

vi /var/www/

Change PHP_BIN; also adjust the PIWIK_PATH variable:


Then run


again. It shouldn't throw any errors anymore.


Share this page:

Suggested articles

0 Comment(s)

Add comment