Vanilla JavaScript Projects

Project 99, SEO and site tools

Privacy Analytics Lite

Know which pages people read without tracking them. No cookies, no personal data, and visitors who ask not to be tracked are simply not counted.

Main API
navigator.sendBeacon
Session
sessionStorage
Dependencies
None
Your browser
Checking

Your mini dashboard

Open some pretend pages, add simulated traffic and watch the charts. The panel shows exactly what would be sent to your server.

0page views, 14 days
0visits
0views per visit
0%from phones

Page views per day

Top pages

    Where visits come from

      Last event sent (no personal data)

      Nothing sent yet

      How it works

      1. Count, do not identifyEach event holds only the page, where the visit came from, the device type and a random session id that lives until the tab closes. No cookies, no IP address.
      2. Respect the signalIf the browser sends Do Not Track or Global Privacy Control, the page view is simply not counted.
      3. Send without slowing the pagenavigator.sendBeacon posts the event in the background, even while the page is closing, so it never delays navigation.
      if (navigator.doNotTrack !== "1" && !navigator.globalPrivacyControl) {
        let session = sessionStorage.getItem("s");
        if (!session) sessionStorage.setItem("s", session = crypto.randomUUID());
        navigator.sendBeacon("/api/hit", JSON.stringify({
          path: location.pathname,
          referrer: document.referrer ? new URL(document.referrer).hostname : "Direct",
          device: innerWidth < 600 ? "Phone" : "Desktop",
          session
        }));
      }