Go Back

Recognizing Visitors

January 23, 2018

Although Piwik PRO is mainly used to see combined data of large numbers, each of those numbers consists of single visitors who have to be recorded by Piwik PRO on their first visit and recognized later when they come back. Piwik PRO implements three different methods to achieve that. The methods are organized in a hierarchy and a lower method is only used when a higher one is not present. Let’s review them from the highest to the lowest.

UserID

Piwik PRO will first check if the visitor has a UserID assigned. The UserID feature allows you to send a customizable information regarding visitor to your Piwik instance. The easiest example is sending Username or email address of your logged in users to Piwik. To achieve that the best solution is to use Piwik PRO Tag Manager and let it do all the work. You can find the exact instructions on how to implement the UserID feature here:

Advanced tracking code modification

Cookie

If Piwik PRO won’t find the UserID parameter it will look for a cookie (first-party cookie, alternatively third-party cookie) with the VisitorID in it. The cookie is the most popular method for recognizing returning visitor and it works automatically when using Piwik PRO JavaScript tracking code. Provided that your visitor accepts cookies you don’t have to worry about anything.

Fingerprint

Should the cookie method fail (or be disabled), Piwik PRO retracts to checking visitor fingerprint to see if the visitor has already been on our site or not. In order to check fingerprint Piwik considers following data from the database:

config_id: a hash of all the visit's configuration options, including the OS, browser name, browser version, browser language, IP address and all browser plugin information

config_os: a short string identifying the operating system used to make this visit. See Device Detector for more info

config_browser_name: a short string identifying the browser used to make this visit. See Device Detector for more info

config_browser_version: a string identifying the version of the browser used to make this visit

config_resolution: a string identifying the screen resolution the visitor used to make this visit (eg, '1024x768')

config_pdf: whether the visitor's browser can view PDF files or not

config_flash: whether the visitor's browser can view flash files or not

config_java: whether the visitor's browser can run Java or not

config_director:

config_quicktime: whether the visitor's browser uses quicktime to play media files or not

config_realplayer: whether the visitor's browser can play realplayer media files or not

config_windowsmedia: whether the visitor's browser uses windows media player to play media files

config_gears:
config_silverlight: whether the visitor's browser can run silverlight programs or not

config_cookie: whether the visitor's browser has cookies enabled or not

If visitor matches the config of one of the previous visitors he will be considered a returning visitor. This method should only be used as a last resort as it is least reliable and may be completely unreliable when a lot of users use the same machine or there are a lot of identical machines used by multiple users.

Additional information

There are a couple of things that you might want to keep in mind regarding mechanisms of marking and recognizing visitors:

  • You can enable a setting in config file called trust_visitor_cookies which will prevent Piwik from trying to use the fingerprint method. This is especially useful for large intranet companies where there are a lot of almost identical computers using the same Internet connection. Contact our support to have this option enabled.
  • By default, 30 minutes after last tracked action of the visitor, a visit is considered finished and next action tracked by the same visitor will start a new visit as a returning visitor. The default time can be altered in the config file.
  • Visitors’ cookies are held for 6 months by default, if no visit will be tracked of such visitor for 6 months, the cookie will expire and he will not be recognized as returning visitor upon his visit.