How is a visitor counted in Piwik PRO?

When a person comes to your website, they can be counted as a visitor multiple times.

Piwik PRO uses three methods to recognize a visitor:

  • Visitor ID: Our JavaScript tracker sets a vistior cookie (_pk_id.*)  in the visitor’s browser and assigns a unique identifier called a Visitor ID. The tracker uses that ID to recognize the visitor. 

    The cookie expires after 13 months by default (or after 30 minutes for anonymous visitors). Also, a visitor can clear cookies at any time. If that happens, the tracker will set a cookie again with a new Visitor ID.

  • Session ID: Our backend tracker creates a hash for each session based on the visitor’s IP address, operating system, browser name, browser version, browser language and enabled browser plugins. During tracking, a temporary link between Session ID and Visitor ID is created. The tracker uses that link to recognize events belonging to the same session.

    The link between Session ID and Visitor ID expires 30 minutes after the last event. Since we don’t store the Session ID anywhere else, it’s impossible to determine returning visitors relying solely on its value.

    The hash itself is not available in any report, but the data used for creating it is visible in raw requests in the tracker debugger for 6 hours. After that time, it’s stored in raw log format for 30 days, but it’s not available in the application interface (We store it only for security reasons: (1) to protect us against malicious actions and bots, (2) to troubleshoot any tracking issues, (3) to recover data in case of data losses.). After that time, it’s permanently deleted.

    The tracker uses Session ID as a primary mechanism to recognize sessions or as a fallback mechanism when it can’t create cookies and use Visitor ID.

    Note: If you turn off Use a session ID (Administration > Sites & Apps > Privacy > Ask visitors for consent (off) > Use a session ID (off)), the tracker will only use Visitor ID from the cookie to recognize visitors.

  • User ID: This is an additional method that the JavaScript tracker can use only after you’ve set up a user ID. The User ID is any unique identifier that you can pass from your site or app to the tracker. It can be the same user ID as in your CMS, CRM or sales system.

    The User ID has the highest rank among mentioned identifiers. If available, the tracker uses it instead of other methods.

If Piwik PRO can recognize a person based on the above information, it will count that person as a visitor. But in some cases, Piwik PRO won’t know that a person is the same visitor.

Here are some of those situations:

  • When a person enters your website on a laptop and mobile, then they will be counted twice.
  • When a person enters your website through different website browsers, then they will be counted multiple times. 
  • When we don’t use User ID or Visitor ID, we may count them multiple times when they change the location or workstation and the IP address changes.

Another important thing to know is that when you look at reports you may see that the number of visitors doesn’t add up as you would think at first glance.

For example:

  • In week one, we had 2 visitors.
  • In week two, we had 2 the same visitors.

Now when we look at a date range for week one, we’ve got 2 visitors, and for week two 2 visitors as well. But, if we take a date range of these two weeks (week one + week two), we’ve got 2 visitors (not 4 as we might think).

Piwik PRO counts (it’s a predictable counting) the number of visitors for each date range so that you could see the number that corresponds to reality the most.

Was this article helpful?

Technical support

If you still have some questions, visit our community.
There’s always someone ready to help!

Back to help center