Repository navigation
feat(site): add Cloudflare Web Analytics beacon - #84
Merged
Merged
Conversation
Both pages gain the Cloudflare beacon alongside the self-hosted Plausible tag. Cloudflare Web Analytics is cookie-free and aggregate-only — per Cloudflare it "does not collect or use your visitors' personal data" — so the page keeps its privacy posture. The subresource contract in check-site.py widens accordingly: FIRST_PARTY_HOSTS becomes ANALYTICS_HOSTS (pulse.tailroute.app plus static.cloudflareinsights.com); everything else cross-origin still fails. The docs footer now states the analytics reality instead of claiming no analytics at all.
Owner
Author
|
Review follow-up (the box's gh token lacked write access at review time, so this landed late):
|
shrwnsan
added a commit
that referenced
this pull request
Oct 14, 2026
The third-party subresource failures said "approved analytics host", which reads oddly when the violator is a font or CSS URL. Say "explicitly allowed host" so the wording survives ANALYTICS_HOSTS growing non-analytics entries. Review follow-up on #84: checker OK 9 checks; full check-site test section passes (the 50 unrelated daemon-test failures are pre-existing on this Linux box — macOS launchd/Tailscale dependent, not touched by this change). Co-Authored-By: Claude Code <noreply@anthropic.com>
shrwnsan
added a commit
that referenced
this pull request
Oct 14, 2026
The third-party subresource failures said "approved analytics host", which reads oddly when the violator is a font or CSS URL. Say "explicitly allowed host" so the wording survives ANALYTICS_HOSTS growing non-analytics entries. Review follow-up on #84. Checker: OK 9 checks; check-site test section all pass. Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this solve?
The site currently measures traffic only through the self-hosted Plausible ingest. This adds Cloudflare Web Analytics as a second, zero-maintenance view of the same aggregate numbers, using the token from the Cloudflare dashboard for tailroute.app.
How does it work?
site/index.html,site/docs/index.html) load the Cloudflare beacon (static.cloudflareinsights.com/beacon.min.js) next to the existing Plausible tag.scripts/check-site.pyenforced a strict subresource contract (same-origin orpulse.tailroute.apponly), so the contract widens deliberately:FIRST_PARTY_HOSTSbecomesANALYTICS_HOSTS—pulse.tailroute.appplusstatic.cloudflareinsights.com, both cookie-free, aggregate-only analytics origins. Anything else cross-origin (fonts, ad scripts, other analytics SaaS) still fails the check, and the deploy workflow runs this check before syncing to gh-pages.Privacy posture
Cloudflare's documented position: Web Analytics "does not collect or use your visitors' personal data", logs no query strings, sets no cookies, and does not fingerprint or track across sites. No consent banner is required. Both allowed origins are documented in one place (
ANALYTICS_HOSTS) so the page's privacy promises stay auditable.Note on the beacon token: it is public-by-design — it ships in the served HTML of every CF Web Analytics site and is not a credential. Worst case for a published token is a third party POSTing fake beacons to inflate the dashboard's numbers.
Breaking changes
None. The checker change ships in the same PR as the beacon — merging only the beacon would have failed the deploy check on main.
Manual testing
python3 scripts/check-site.py→ OK 9 checkstests/run-tests.sh→ 465/465 (includes a new test pinning the beacon as allowed)Related
Keeps both analytics sources. If Cloudflare replaces the self-hosted Plausible long-term, the follow-up is to drop the
pulse.tailroute.apptag and shrinkANALYTICS_HOSTSaccordingly.