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 keep the following setting turned on: Tag Manager > Tags > Piwik PRO tag (tracking code) > Respect visitor privacy (on).
  • A visitor didn’t agree to data collection and usage on your site.
  • 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: When you use Consent Manager and ask visitors for consent to personal data collection and usage, some of them won’t agree. So can you collect any data from these visitors? It depends on privacy laws and how your legal team interprets them. Read more

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. We’ll cover these topics 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.