If you want to improve your web offer and tailor it precisely to the behaviour of your visitors, then you need a web tracking programme. The most prominent online service for this is Google Analytics. A worth­while al­tern­at­ive to Google Analytics is the free open source programme Piwik. This al­tern­at­ive is in no way inferior to its more widely known com­pet­it­or — it’s even slightly ahead of Google when it comes to data pro­tec­tion: With Piwik, you can save the collected data on your own server. Plus, the necessary settings for legally using tracking methods can be con­figured much more easily with Piwik than with Google Analytics. Piwik can also easily be used as a plugin for WordPress websites; the extension for the content man­age­ment system enjoys re­l­at­ively high pop­ular­ity thanks to its highly suc­cess­ful im­ple­ment­a­tion. After in­stalling the plugin, activate Piwik in WordPress by gen­er­at­ing and pasting a tracking code. In the following para­graphs, we’ll tell you how exactly it works and which benefits the Piwik WordPress extension offers.

Piwik: Lots of functions and full control over collected data

Piwik is a web tracking programme that analyses and stat­ist­ic­ally processes data about traffic on your website. After Google Analytics, it’s one of the most-used analysis tools for eval­u­at­ing your internet presence. With Piwik, you get in­form­a­tion about how often and from where your web presence is accessed, as well as how visitors behave while they are on your site. You’ll be able to see which subpages of your website were visited, when, and for how long. You will receive in­form­a­tion on whether your guests reached you directly by entering the URL, or whether they found you via a search engine or by clicking on links and arriving via other websites. If your site was found using a search engine, you can also see which search terms visitors used. These stat­ist­ics and others are made available by Piwik. In addition, the tool can be used to check the extent to which certain defined goals of your website are being achieved. If for example, specific subpages are prefer­ably accessed, special files down­loaded, or user contact data trans­mit­ted (for example, for a news­let­ter), you can use Piwik to un­der­stand how often this happens and how suc­cess­ful your actions are. In addition to many other useful functions, the programme also enables the automatic creation of reports on how your website is being used. As opposed to Google Analytics, Piwik gives you the pos­sib­il­ity of in­stalling the programme on your own server and saving collected data on your own server (Google’s tool stores all of the data on the company’s servers, which is po­ten­tially critical in terms of data pro­tec­tion). This makes the tool an in­ter­est­ing al­tern­at­ive, es­pe­cially for users who place a lot of worth on the security and full control of data. The maker of the web tracking tool also offers a paid cloud version of the ap­plic­a­tion with Piwik PRO, which gives users access to premium functions, support, customer service, and much more.

Important Piwik functions in the WordPress dashboard

In 2009, the plugin published for the first time in version 0.2.0 under the name WP-Piwik – this was the first publicly ac­cess­ible Piwik extension for WordPress. André Bräkling (the author of the plugin) announced in mid-2015 that the developer team had succeeded in offering WP-Piwik as a complete in­teg­ra­tion of the web analytics tool for WordPress. Users of the extension were now given a variety of features and analysis options — with Piwik for WordPress, you have access to the following functions in the dashboard:

  • Stat­ist­ics on in­di­vidu­al WordPress website traffic:
    • Geo­graph­ic location of users and time of day for page visits
    • In­form­a­tion about the operating system, the browser (in addition to the provider, which plugins are activated during the site access are also noted), and the user’s type of device (whether a desktop, tablet, or smart­phone was used)
    • Visitor source (was the website accessed via a link or with the input of the address into the browser’s URL bar?)
    • Executed actions of the user on the website (which links were clicked on, which areas of the site were scrolled through, etc.)
    • Retention time of website visitors
    • World map, showing where all website visitors are located in real time
    • With the “Row Evolution” function, you can choose certain cat­egor­ies from the collected data and compare their de­vel­op­ment over a freely definable period of time
  • E-commerce tracking: Doc­u­ment­a­tion of various actions from online shop visitors (orders, shopping cart updates, product and category page views).
  • Set and analyse goals in con­nec­tion with the website: Down­load­ing par­tic­u­lar files, sub­scrib­ing to a user account or a news­let­ter, or accessing a par­tic­u­lar web page or video, can all be tracked, among other actions.
  • In­form­a­tion on the speed of website file transfers: How quickly is the website’s content presented to the visitor?
  • Usage analysis of the internal website search function: Eval­u­ation of the search terms used by visitors in the website’s internal search mask, as well as the general usage of the search function.
  • Comment function: Comments (i.e., stat­ist­ics, analysis results, and changes to a website) can easily be retained using the comment function.

Setting up Piwik

Even though Piwik isn’t as simple to get up and running as Google Analytics, the in­stall­a­tion still isn’t es­pe­cially difficult. The Piwik software always has to be played on your web server - this process is also necessary if you want to utilise the web analysis tool on its own in WordPress with the plugin.

Install Piwik on the server

To link your site to Piwik, you need access to the web server of the internet presence that you want to analyse with web tracking. To be able to use Piwik in the WordPress dashboard, you first need to set the programme up on the web server that is linked to your WP site. The in­stall­a­tion of the programme really is quite straight forward:

  1. Use the download programme for the official Piwik site.
  2. Unpack the ZIP file.
  3. Download the unzipped directory to your server com­pletely in binary mode via an FTP client. It’s re­com­mend­able to create a new Piwik folder at this interval.
  4. On the server, you can place Piwik in a subfolder of your website (Example: example.com/piwik) — or give the programme its own subdomain (Example: piwik.example.com).
  5. Access the ap­pro­pri­ate your website’s Piwik domain that you created in step 4 in the web browser. An assistant will now lead you through the in­stall­a­tion process.
  6. After the in­stall­a­tion assistant has evaluated your system re­quire­ments, it will request the required in­form­a­tion about your database. It’s a good idea to create a new database for Piwik on your host. Piwik requires a MySQL or MariaDB database.
  7. Now enter the website that you wish to have analysed using Piwik (you can add other websites later).
  8. A code is now displayed. This is a so-called tracking code. It can track the behaviour of visitors on a website that it’s linked with. It is, therefore, very important when it comes to web analysis. To evaluate your entire website with Piwik, copy the tracking code into every website of your online presence. If you use a content man­age­ment system, then it’s generally suf­fi­cient to enter this code once in the footer section of the template before the final body tag. Your site is now linked with Piwik and can be analysed by the tool.

Install Piwik in WordPress by tracking code

If you want to connect Piwik to your WordPress site, it’s easiest to use the WP-Piwik extension (the official Piwik plugin for WordPress). With this, you can auto­mat­ic­ally integrate the Piwik code into WordPress, replacing step 8 from the process explained above. To do this, perform the following steps after in­stalling Piwik:

  1. Log in to WordPress.
  2. Go to the “Plugins” menu and search for “WP-Piwik”. Install this and activate it.
  3. In WordPress, click on the tab “Settings” à “WP-Piwik”. Enter the Piwik domain of your website under “Piwik URL”. In the next field, enter your Auth Token. You can find the Auth code by accessing your Piwik domain and looking under the “API” menu tab in the personal settings. Once you’ve entered the URL and Auth Token in WordPress, apply the changes.
  4. Now switch to the “Activate tracking” tab in the WP-Piwik settings, change the tracking code in “Standard tracking” and save.
  5. Go back to the “Connect with Piwik” tab. Untick the box next to auto-con­fig­ur­a­tion and apply the changes. Now you can click on your website in the “Select site” menu tab.
  6. After you have selected your website and saved these changes, your WordPress is equipped with Piwik. Now you can access the tool either via the WordPress dashboard or simply using the Piwik directory of your website in the browser.

Piwik’s service and privacy-compliant con­fig­ur­a­tion

It doesn’t matter whether you access Piwik via your domain or using WordPress: You always operate the programme through an orderly user interface in the browser, giving you access to the desired stat­ist­ics. The menu nav­ig­a­tion is seen by some users as slightly hazier than that of Google Analytics; but after a short training period at the most, Piwik will become easy to handle. You also have mobile access to the usage data of your website — both Android and iOS have a Piwik app available. Piwik scores par­tic­u­larly well regarding the pro­tec­tion of in­form­a­tion that it collects. The tool can be set to comply with various data pro­tec­tion reg­u­la­tions without requiring much effort.

In regard to the legal situation of the analytics programme, it is generally con­sidered safe and compliant software when it comes to privacy reg­u­la­tions. The data privacy agencies in both Germany and France have publicly re­com­men­ded the software. It is used by the gov­ern­ments of many other countries as well. This is partially because it’s one of the few ana­lyt­ic­al tools that doesn’t require the use of cookies and because collected data is stored directly in your own database and not auto­mat­ic­ally shared with any other servers. While many data pro­tec­tion policies in the US are voluntary, we will tell you in the following sections how to change the tracking settings of the software in regard to IP address use or the use of cookies so as to be privacy compliant.

Auto­mat­ic­ally anonymise visitor IPs

While there is no official ruling in the US, IP addresses have been ruled in the EU to count as personal data in some cases. Because of this view, the pref­er­ence is that they not be stored in order to protect privacy. The de­velopers of Piwik know that web tracking can quickly come into conflict legally speaking, so they have provided users with the ap­pro­pri­ate options for cus­tom­ising their web analytics. For example, the IP addresses of your visitors can be auto­mat­ic­ally an­onym­ized to ensure policy-compliant web tracking.

Making the IP addresses of all website users anonymous only requires a few clicks: You simply have to make a few changes under “Settings” à “Privacy” in the server-installed Piwik software. In the menu, click to “Anonymise the IP address of visitors” and then determine that the last two bytes of the IP addresses of all of your visitors should be obscured. Also, in the last selection field, confirm that the anonymous IP address is used for the pre­par­a­tion of visits.

These settings sig­ni­fic­antly limit the geo­loca­tion of users (only the country of origin can be traced instead of the city and region). This is a policy-compliant way to continue to collect data on your users and suc­cess­fully analyse your website.

Offer an opt-out

Beyond the con­ceal­ment of an IP address, you should take further measures in regard to data pro­tec­tion: Website visitors must have the op­por­tun­ity to make a general decision against the col­lec­tion of user data — this option is called an opt-out. With the help of an HTML<iframe> tag, these elements can be im­ple­men­ted. The code snippets can also be found in the Piwik menu under “Privacy” (at the bottom of the page). You can easily embed the opt-out by copying the displayed code and inserting it into a web page.

After im­ple­ment­ing the opt-out HTML code, website users can decide against the col­lec­tion of their data with just one click. When this happens, a cookie is created in the visitor’s browser that prevents tracking from Piwik.

WordPress and Piwik: What to do when you encounter an error message?

It’s possible that Piwik may ex­per­i­ence errors during tracking. This is more likely to happen with a self-hosted Piwik in­stall­a­tion than the Google Analytics tool, primarily because you take care of the programme’s main­ten­ance yourself (as opposed to leaving the process to Google). Here, a missing update of Piwik is of­ten­times re­spons­ible for the problems with the web tracking. Piwik’s developer publishes new versions of the open source ap­plic­a­tion fairly regularly. If mal­func­tions still exist after updating the software, then a look at the official Piwik forum could help. Fre­quently occurring problems with the programme are also discussed on the Piwik website in the “Troubleshoot­ing” section. There you’ll find in­form­a­tion on more than 50 different issues. If you don’t want to deal with managing or updating the tool, or simply lack the necessary knowledge, then you have the op­por­tun­ity of sub­scrib­ing to the premium version of Piwik. The ap­plic­a­tion will no longer be free but you can profit from support services offered by Piwik's developer (i.e., programme in­stall­a­tion and setup, advice on how Piwik works, etc.).

Pro­fes­sion­al web tracking with Piwik – also in the WordPress dashboard

Overall, Piwik is a web analytics programme that earns points based on its range of functions as well as the pos­sib­il­it­ies of data pro­tec­tion-compliant usage. The WP plugin allows you to view the tracking results directly in the backend of WordPress. It also impresses with its user-friendly operation. All in all, this makes Piwik a very soph­ist­ic­ated tracking programme that remains available to users free of charge.

However, when operating this web analysis tool, you still need to make sure that you’re aware of and compliant with the legal framework in regard to data pro­tec­tion. It’s also important to ad­equately maintain the software and keep up-to-date with the most current version of the plug-in. If this seems like too much effort to you, or you don’t have the necessary know-how for the required ad­min­is­tra­tion, the paid Piwik PRO version might be the al­tern­at­ive for you. With the pro version, you’re not only relieved of the re­spons­ib­il­ity for main­tain­ing the software, you are also given lots of help, extra functions, and more.

Last but not least, there’s yet one more point to consider: As soon as you connect the programme with your website and use it for web analysis, you must also trans­par­ently disclose the Piwik usage in the privacy policy of your website and refer to the use of the tool.

Go to Main Menu