APAnalytics

Case Study: Privacy-First Real-Time Telemetry Engine
APAnalytics is a modern, lightweight web analytics platform designed to replace heavyweight, invasive tracking tools like Google Analytics. Built for performance and privacy, it provides deep behavioral insights without setting tracking cookies or collecting PII.
Engineering Challenges & Constraints
- Sub-Kilobyte Tracking Script: The client-side beacon needed to weigh less than 1KB, execute asynchronously, and preserve 100/100 Core Web Vitals for tagged sites.
- GDPR/CCPA Compliance by Design: Tracking unique sessions across page visits without persistent cookies or raw IP address storage.
- High-Throughput Ingestion: Processing millions of monthly beacon hits concurrently with minimal server resource overhead.
Architecture & Technical Innovation
I engineered a high-velocity event ingestion pipeline:
- Daily Salted IP Hashing: Generated privacy-safe session identifiers using SHA-256 hashes of client IP, User-Agent, and a rotating daily cryptographic salt. Sessions cannot be tracked across days or sites.
- Lightweight Beacon API: Built an 850-byte tracker utilizing the browser `navigator.sendBeacon` API to prevent render-blocking.
- PostgreSQL Time-Series Indexing: Structured event logs with BRIN and composite indexes, enabling multi-step funnel aggregation across millions of rows in under 80ms.
- Uptime Monitoring Daemon: Implemented an automated background health-check service monitoring endpoint status codes and latency worldwide.
Performance Metrics & Impact
12k+
Active Sites Monitored
< 1KB
Tracker Script Size (Zero Lag)
100%
GDPR & CCPA Compliant (Zero Cookies)
Gallery




