Most analytics scripts are massive. Google Analytics loads ~82 KB of JavaScript. Even privacy-focused alternatives like Plausible (~1 KB) and Umami (~2 KB) are significantly larger than they need to be.
I built Fairlytics with a tracking script that's 510 bytes gzipped. Here's the technical story of why and how.
Why small matters
Every byte of JavaScript your page loads has a cost:
- Parse time on mobile devices
- Network transfer on slow connections
- Render-blocking potential
- Core Web Vitals impact
For an analytics script that runs on every page of your site, these costs multiply across every single page view.
The privacy pipeline
When a visitor loads a page with Fairlytics, here's what happens:
- The 510-byte script sends a POST request with 4 fields: site ID, page URL, referrer, and page title
- Server receives the request along with the IP address and User-Agent (standard HTTP)
- The IP is used for an in-memory GeoIP lookup → produces a 2-letter country code → IP is discarded (never stored)
- The User-Agent is parsed into browser family + OS family → raw string discarded
- Referrer is reduced to domain only
- Query parameters are stripped from the URL
- A daily-rotating anonymous hash is generated for unique visitor estimation (no cookies needed)
What gets stored: page_path, page_title, referrer_domain, country_code, browser_family, os_family, device_type, session_id, viewed_at
What never touches the database: IP addresses, full user agents, full referrer URLs, query parameters, any form of persistent user ID.
How the script works
The tracker is vanilla JavaScript, no dependencies. It:
- Reads the
data-siteanddata-apiattributes from its own script tag - Sends a single POST request on page load
- Listens for
popstateevents for SPA navigation - Checks for DNT and GPC signals — if either is set, it does nothing
- Uses
navigator.sendBeaconwhen available for non-blocking requests
That's it. No event queue, no batching, no retry logic, no session management, no cookie handling.
What you get without cookies
Without setting any cookies, Fairlytics provides:
- Page views and unique visitors (via daily-rotating hashes)
- Top pages by traffic
- Referrer sources (domain only)
- Country, browser, OS, and device type breakdowns
- Goal tracking for custom conversion events
- Real-time dashboard
The comparison
| Google Analytics | Plausible | Fairlytics | |
|---|---|---|---|
| Script size | ~82 KB | ~1 KB | 510 bytes |
| Cookies | 2-4 | 0 | 0 |
| Consent banner needed | Yes | No | No |
| Data points per pageview | 17+ | ~8 | 4 |
| IP storage | Yes | Temporary | Never |
Try it
Fairlytics is live and free to try (10K pageviews/month, no credit card):
<script src="https://app.fairlytics.dev/js/tracker.v1.js"
data-site="YOUR_SITE_ID"
data-api="https://app.fairlytics.dev"></script>
One line. 510 bytes. Zero cookies.
Website: https://fairlytics.dev
Live demo: https://fairlytics.dev/demo/
Top comments (0)