Agent Wranglers

Privacy Recommended

Count visits without tracking people

Measure without tracking people. Use no analytics, or analytics without cookies or personal data.

How to do it

Use no analytics, or a self-hosted tool that sets no cookies and stores no personal data. Say which in the privacy policy. See also keep a tracking plan in the code.

Example

// Sends only the path. The server must store no IP address or ID with it.
navigator.sendBeacon('/stats', JSON.stringify({ path: location.pathname }));
# Flask: count paths only, with no IP address, cookie or user agent
from collections import Counter
counts = Counter()

@app.post("/stats")
def stats():
    path = str((request.get_json(force=True, silent=True) or {}).get("path", ""))[:200]
    counts[path] += 1
    return "", 204

How to check

With a fresh browser profile, a visit sets no cookies or storage for analytics. The stored analytics rows contain no IP address, user agent or ID.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/privacy/analytics-privacy.