A Case Against JavaScript Analytics
For years, Google Analytics served as little more than a glorified hit counter. The interface grew more complex, the tracking more intrusive, and the numbers increasingly suspect. After switching to Goatcounter — a privacy-friendly alternative that avoids cookies and GDPR notices — a problem emerged: adblockers were blocking the analytics themselves. The site's own traffic reporting was being filtered before it ever reached the analytics backend.
That realization raises a fundamental question: if a substantial portion of your audience runs adblockers, what are your analytics actually measuring? For a technical audience, the answer is: not much. A recent Hacker News spike provided a concrete comparison — roughly 13,000 unique visitors reported by analytics versus an estimated 38,000 actual non-robot visitors. That's a 2.5x discrepancy, implying that around 60% of visitors run adblockers. At that level, JavaScript-based analytics are sampling a subset, not measuring your audience.
Log Analysis with GoAccess
An alternative is to go back to basics: read the server logs. GoAccess is a log parser and visualizer that handles common formats from Apache, Nginx, ELBs, and CloudFront, offering both a terminal UI and an HTML web output. This site runs on S3 with CloudFront, so enabling logging is a matter of configuration in the distribution settings. A log prefix helps when multiple sites share a bucket.
To keep things tidy, set an S3 lifecycle rule on the logging bucket to expire logs after a fixed period — say, 30 days — which also protects visitor privacy by retaining less data. The rule lives under the bucket's Management section.
Scripting the Workflow
Rather than memorize complex invocations, a Git repository of helper scripts simplifies the process. One script syncs the logging bucket locally via awscli; another streams gzipped logs into GoAccess while filtering out excluded paths. The result is a simple, repeatable command for generating analytics views without touching a JavaScript tag.
Deeper Queries with Athena
GoAccess covers the basics, but for arbitrary SQL over log data, AWS Athena is a strong fit. Athena runs on Presto, an engine built for large distributed datasets, and reads directly from files on S3 — no data warehouse or central storage required. That makes it natural for querying CloudFront access logs.
Defining a Schema
Setup begins in the AWS console by creating a database — avoiding hyphens in names is wise, as the error messages are not friendly — then a table that matches the CloudFront logging format. The LOCATION clause points at the S3 path housing the logs.
The Athena web UI is rough, but the underlying service is a gift: someone else operates the Presto cluster. And the UI problem is solvable. AWS exposes a full API for Athena, reflected in awscli, so a small script can submit a query, poll for completion, and render results in tabular form. Taking a *.sql file as input means queries get syntax highlighting in an editor and version control in Git — two advantages the default console lacks.
For a dataset on the order of 100 MB to a few GB, Athena responds in seconds. Queries for unique visitors per day or top articles this month execute quickly, and the price — $5 per TB scanned — stays low for a site generating modest log volume. Shorter retention periods cut costs and improve privacy simultaneously.
Measuring the Adblocker Gap
Comparing online analytics against log-based methods yields a rough estimate of adblocker prevalence. During a recent Hacker News spike, both Google Analytics and Goatcounter reported ~13,000 unique visitors over a couple of days. GoAccess and custom Athena queries agreed on ~33,000 — after filtering robots, static files, and duplicates — giving a 2.5x ratio and suggesting ~60% of readers block analytics.
Analytics tools remain useful for measuring trends on a sample, but they do not present the whole picture. Privacy-conscious options like Goatcounter still offer value — capturing JavaScript-only data such as time-on-site and screen size — but for accurate traffic counts, log parsing with GoAccess and Athena is hard to beat.



