I run a small file converter, imageconvert.art . Like most side projects, I wanted to know one thing: are real people using it?
I didn't want Google Analytics (cookie banner, a third-party script on every page, data I don't need). So I wrote a tiny page-view counter of my own. On the first day it said I had visitors. Lots of them. Most of them, it turned out, weren't people.
Here's how I fixed it with five small checks. No cookies, no fingerprinting, nothing stored that identifies anyone.
The naive version
Count a view every time the server renders a page. That counts everything: Googlebot, Bingbot, uptime monitors, SEO crawlers, link previews from chat apps, and the random scanners that hit every new domain looking for /wp-login.php .
Moving the count to a JavaScript beacon fixes the simplest crawlers, because they never run JavaScript:
navigator . sendBeacon ( "/ui/v" , JSON . stringify ( { p : location . pathname , r : document .…