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 hash
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, that is, 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 ends 30 minutes after the last event, and Piwik PRO uses a Cookie ID
, Session hash
and User ID
to recognize events that 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) time of first visit and (4) time of last visit in order to count that visitor’s session accurately.
Returning customer
If you use 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 has previously ordered something 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 find that the number of visitors doesn’t always add up to what you might have expected.
For example:
- The first week we had 2 visitors.
- The second week we had the same 2 visitors.
Now, if we look at a date range for week one, we have 2 visitors, and for week two, we also have 2 visitors. 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 have assumed at first glance). This is because each of the two visitors is only counted once, no matter how many times they visit, because they’re recognized as the same visitor.