Ten days of analytics that measured nothing
My site had Cloudflare Web Analytics from the day it moved to Workers. auto_install on, the ruleset enabled, a rule matching * on every path. Ten days later I looked at /, /cv and a project page and they had zero hits each.
Curling the live page and grepping for the script showed why. It wasn’t there. The beacon had never been in the HTML.
The cause I ruled out
Automatic install injects the snippet at Cloudflare’s proxy on the way out. My site is served by Workers static assets, and the injection never reached those responses. It wasn’t the documented cause, a Cache-Control: no-transform header: _headers doesn’t set it. I never found the real reason.
I didn’t need it. A manual embed is the supported fallback and works whatever the mechanism is:
<script type="module" src="https://static.cloudflareinsights.com/beacon.min.js"
data-cf-beacon='{"token": "33df58d3db3b4cd5b2329560b66e8e2e"}'></script>
The token is public by design. It ships to every visitor, so it belongs in git.
The type="module" matters. Automatic injection adds it and a manual embed doesn’t, and without it the script throws on old browsers. Cloudflare also supports only one snippet per page, so once the manual one was on all 23 pages I turned auto_install off through the API. It was doing nothing then, but if injection ever started reaching Worker responses, every page would have had two.
The fix
It had been on my list as “ten minutes, needs a token from the dashboard”. Ten days of traffic went unmeasured before I looked. The home lab series had gone up at /writing/ that night, 47 minutes before the fix was committed. It went live in its own build at 00:36 with no beacon, and the fix built at 01:22. So the launch ran unmeasured too.
The fix was one line per page in three places: the shared chrome script that renders 21 pages, plus index.html and cv.html, which carried their own copy.
The same night a check went into the gate I run before pushing. It counts static.cloudflareinsights.com on every built page and fails on anything but one. Zero is this bug. Two is what turning auto_install back on would do.
Now when a dashboard says something is on, I curl the page and look for it.