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 be able to 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 user visits a page, the tracking code grabs information about that user 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 user 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 user 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 user will be invisible to Piwik PRO, and Piwik PRO will not collect any information about their visit.

Types of collected data

The tracking code’s job is to monitor user 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 user 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 user, like 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.