Chapter 03

How Piwik PRO works

By Anna Tomalik

Once you realize why you are collecting data, you can learn how Piwik PRO does it. This knowledge is useful because if you understand the mechanism you’ll make conscious choices about data you want to have and you’ll know what data you see in reports.

Piwik PRO uses a tracking code (a JavaScript code) to collect data about people who visit your site. The tracking code is embedded on your web pages. Every time a visitor comes to a page, the tracking code grabs information about that visitor and sends it to Piwik PRO. Then Piwik PRO organizes this data into reports.

Sometimes, Piwik PRO can’t collect any data. It happens when:

  • A visitor enabled a do-not-track setting in their browser, and you enabled a do-not-track setting in Piwik PRO (it’s up to you whether you want to respect people’s privacy or not).
  • A visitor didn’t agree to use cookies for tracking their behavior on your website.
  • You didn’t install a tracking code on a page you want to monitor.
  • You deliberately excluded an IP address, query URL, or user agent.

In all these scenarios, the visitor will be invisible to Piwik PRO, and Piwik PRO will not collect any information about their visit.

Note: In case a visitor refused to be tracked, and we use an anonymous tracking, you will get partial data about their visit.

Types of collected data

The tracking code’s job is to monitor visitor’s interaction with your website. To do that, it uses cookies. When a person comes to your site for the first time, the tracking code drops a cookie in their browser (unless they don’t agree to the use of cookies). Using that cookie, the tracking code can count the number of sessions a visitor had on our website. It can differentiate between new and returning visitors. It can see what website, ad, or social media referred them to our site. And it can collect other specific information about the visitor, such as the language they use in the browser, their location, or the device they are using.

These are just a few pieces of information the tracking code can collect, and it can do way more if we define goals, or set up events in Piwik PRO. But these we’ll cover in an advanced course. At this point, you need to know that the tracking code works with cookies to collect useful data. Then, it passes the data to Piwik PRO, where that data is turned into reports.