If you want to improve your web offer and tailor it precisely to the behavior of your visitors, then you need a web tracking program. The most prominent online service for this is Google Analytics. A worth­while al­ter­na­tive to Google Analytics is the free open source program Piwik. This al­ter­na­tive is in no way inferior to its more widely known com­peti­tor — 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­fig­ured 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 rel­a­tive­ly high pop­u­lar­i­ty thanks to its highly suc­cess­ful im­ple­men­ta­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 program that analyzes and sta­tis­ti­cal­ly 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­for­ma­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­for­ma­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 sta­tis­tics 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 newslet­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 program also enables the automatic creation of reports on how your website is being used. As opposed to Google Analytics, Piwik gives you the pos­si­bil­i­ty of in­stalling the program 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­tial­ly critical in terms of data pro­tec­tion). This makes the tool an in­ter­est­ing al­ter­na­tive, es­pe­cial­ly 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­pli­ca­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­ces­si­ble 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­te­gra­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:

  • Sta­tis­tics on in­di­vid­ual WordPress website traffic:
    • Ge­o­graph­ic location of users and time of day for page visits
    • In­for­ma­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­e­gories from the collected data and compare their de­vel­op­ment over a freely definable period of time
  • E-commerce tracking: Doc­u­men­ta­tion of various actions from online shop visitors (orders, shopping cart updates, product and category page views).
  • Set and analyze 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 newslet­ter, or accessing a par­tic­u­lar web page or video, can all be tracked, among other actions.
  • In­for­ma­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­a­tion 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., sta­tis­tics, 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­stal­la­tion still isn’t es­pe­cial­ly difficult. The Piwik software always has to be played on your web server - this process is also necessary if you want to utilize 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 analyze with web tracking. To be able to use Piwik in the WordPress dashboard, you first need to set the program up on the web server that is linked to your WP site. The in­stal­la­tion of the program really is quite straight forward:

  1. Use the download program for the official Piwik site.
  2. Unpack the ZIP file.
  3. Download the unzipped directory to your server com­plete­ly in binary mode via an FTP client. It’s rec­om­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 program 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­stal­la­tion process.
  6. After the in­stal­la­tion assistant has evaluated your system re­quire­ments, it will request the required in­for­ma­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 analyzed 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 behavior 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 analyzed 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 au­to­mat­i­cal­ly 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. Uncheck the box next to auto-con­fig­u­ra­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­u­ra­tion

It doesn’t matter whether you access Piwik via your domain or using WordPress: You always operate the program through an orderly user interface in the browser, giving you access to the desired sta­tis­tics. The menu nav­i­ga­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­lar­ly well regarding the pro­tec­tion of in­for­ma­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 program, it is generally con­sid­ered safe and compliant software when it comes to privacy reg­u­la­tions. The data privacy agencies in both Germany and France have publicly rec­om­mend­ed 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 an­a­lyt­i­cal tools that doesn’t require the use of cookies and because collected data is stored directly in your own database and not au­to­mat­i­cal­ly 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.

Au­to­mat­i­cal­ly anonymize 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­vel­op­ers 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­tomiz­ing their web analytics. For example, the IP addresses of your visitors can be au­to­mat­i­cal­ly anonymized 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 “Anonymize 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 prepa­ra­tion of visits.

These settings sig­nif­i­cant­ly limit the ge­olo­ca­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­ful­ly analyze 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­tu­ni­ty 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­ment­ed. 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­pe­ri­ence errors during tracking. This is more likely to happen with a self-hosted Piwik in­stal­la­tion than the Google Analytics tool, primarily because you take care of the program’s main­te­nance yourself (as opposed to leaving the process to Google). Here, a missing update of Piwik is of­ten­times re­spon­si­ble for the problems with the web tracking. Piwik’s developer publishes new versions of the open source ap­pli­ca­tion fairly regularly. If mal­func­tions still exist after updating the software, then a look at the official Piwik forum could help. Fre­quent­ly occurring problems with the program are also discussed on the Piwik website in the “Trou­bleshoot­ing” section. There you’ll find in­for­ma­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­tu­ni­ty of sub­scrib­ing to the premium version of Piwik. The ap­pli­ca­tion will no longer be free but you can profit from support services offered by Piwik's developer (i.e., program in­stal­la­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 program that earns points based on its range of functions as well as the pos­si­bil­i­ties 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 so­phis­ti­cat­ed tracking program 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­e­quate­ly 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­ter­na­tive for you. With the pro version, you’re not only relieved of the re­spon­si­bil­i­ty 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 program with your website and use it for web analysis, you must also trans­par­ent­ly disclose the Piwik usage in the privacy policy of your website and refer to the use of the tool.

Go to Main Menu