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.