Skip to content

Privacy

Visitor hash

A visitor hash is an anonymous identifier that cookieless analytics computes on the server to tell visitors apart. It is a one-way hash of a few request details and a secret salt, and because the salt is replaced every day, the identifier changes every day too.

Also called daily rotating hash, anonymous visitor id, salted hash Updated

visitor id = SHA-256(daily salt | site id | IP address | user agent)

How is it calculated?

The server joins the daily salt, the site id, the IP address and the user agent, and runs them through a cryptographic hash such as SHA-256. The output is the visitor id for that day. The inputs are not stored.

When the day ends the salt is deleted. Without it, old ids cannot be recomputed from an IP address, and an id from one day cannot be linked to an id from the next. Including the site id means the same person gets unrelated ids on different sites.

Example

Two people in the same office share an IP address but use different browsers, so their user agents differ and they get different hashes. Tomorrow both get new, unrelated hashes. Two colleagues with identical browsers on that shared IP would be counted as one visitor.

Common mistakes

  • Calling an unsalted hash of an IP address anonymous. IPv4 addresses are few enough to reverse by trying them all.
  • Keeping the salt. If old salts are retained, old ids can be recomputed and the rotation protects nothing.
  • Expecting to follow a visitor across days. The design exists to prevent exactly that.

How CrispStats shows it

CrispStats computes the visitor id at the edge as a SHA-256 hash of a daily salt, the site, the IP address and the user agent, then discards the IP address and user agent. The salt is random, kept only for its day and removed shortly after it ends, so yesterday’s ids cannot be recomputed or linked to today’s. A session still open at midnight keeps its id briefly, so one visit is not cut in two.

Your traffic, crisp and clear

One script, no cookies, and every feature from the first day. Set up takes about as long as pasting a snippet.