Skip to content

How counting works

The collector computes, for each event:

visitor = HMAC(daily salt, site id · IP address · user agent)
  • The salt is secret, encrypted at rest, and changes at midnight in your site’s time zone. Old salts are deleted, so a hash cannot be reversed or recomputed later.
  • The site id is part of the input, so the same person on two of your sites is two visitors.
  • The IP address and user agent are used in memory and dropped.
  • A visitor counts once per local day. Over a week, someone who came on three days counts three times: the visitors of a range are the sum of its daily counts, and every report says so.
  • People sharing a network and the same browser can merge into one visitor.
  • A device that changes address during the day (moving from Wi-Fi to mobile data) can split into two.

A visit is a visitor’s activity until 30 minutes pass without an event, so it never spans midnight.

If your product has signed-in users, identify with an opaque id adds a keyed hash of it (specific to your site) to their events, without storing the id itself.