The symptom
I built my own analytics: opt-in, cookieless, first-party, no third-party scripts, the whole privacy-friendly checklist. It worked in testing. Then the public /stats page kept showing nothing. Not low numbers. Zero. Active visitors, page views, the live map: all empty, most of the time.
The strange part was that it was not always empty. Some visits registered. And when I opened the network tab on my own machine, with consent granted, the collect request was sitting there in red: net::ERR_BLOCKED_BY_CLIENT. The browser was refusing to send it, and the server never heard a thing.