What are visitors and how are they counted?

A visitor is a person who visits your site or app on their computer, tablet, phone or other device. Keeping track of visitors and identifying them is important for every site or app owner. However, it can be difficult to count visitors accurately, especially when trying to figure out if they are new or returning visitors.

In this article, we’ll explore the different ways that visitors are counted and the challenges that come with tracking them.

New visitor

Piwik PRO uses session and visitor identifiers like Cookie ID and Session ID to recognize visitors and their session. However, when it comes to recognizing new and returning visitors, it only uses the Cookie ID and other information stored in the _pk_id cookie.

Piwik PRO will count a visitor as new if it doesn’t find the _pk_id cookie in their browser. This can happen when:

  • A visitor is coming to your site or app for the first time.
  • A visitor is anonymous. They didn’t consent to data collection and usage. 
  • A visitor returned to your site after clearing cookies.
  • A visitor browsed your site on a computer and switched to a different browser, computer or mobile device.
  • You’re using cookie-less tracking.
  • The _pk_id cookie has expired. By default, it expires 13 months after it is set. (This period can be changed in Menu > Tag Manager > Tags > Piwik PRO (tracking code) > Remove the visitor cookie at custom time.)

Note: Keep in mind that a session lasts 30 minutes, and Piwik PRO uses a Cookie ID, Session ID and User ID to recognize that events belong to the same person. Read more

Note: Our SDK for mobile apps doesn’t recognize new and returning visitors.

Returning visitor

If Piwik PRO finds the _pk_id cookie in the visitor’s browser, it’ll count that person as a returning visitor. Piwik PRO will also check: (1) the Cookie ID (2) visit count (3) first visit time and (4) last visit time to count that visitor’s session accurately.

Returning customer

If you use an ecommerce tracking, Piwik PRO will check the lastEcommerceOrderTimestamp parameter in the _pk_id cookie. This parameter stores information about the time of the last tracked ecommerce order. If a visitor ordered something before from your store, they will be counted as a returning customer.

How are visitors counted in reports

When you look at the reports, you may notice that the number of visitors doesn’t add up to what you might think at first glance.

For example:

  • The first week we had 2 visitors.
  • The second week we had 2 of the same visitors.

Now, if we look at a date range for week one, we have 2 visitors, and for week two, we have 2 visitors as well. But if we take a date range of those two weeks combined (week one + week two), we’ll still have 2 visitors (not 4 as we might think).

Piwik PRO counts (it’s a predictable count) the number of visitors for each date range. This way you can see the number that most closely matches reality.

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