Skip to content

Let the Cloudflare Web Analytics beacon load - #20

Merged
antigenius0910 merged 1 commit into
mainfrom
feature/allow-web-analytics-beacon
Oct 29, 2026
Merged

antigenius0910 merged 1 commit into
mainfrom
feature/allow-web-analytics-beacon

Conversation

@antigenius0910

Copy link
Copy Markdown
Contributor

The chuangwangfu.com zone has Cloudflare Web Analytics in automatic mode, which injects the RUM beacon into every subdomain's HTML, including driftline.chuangwangfu.com. The CSP added in #19 (default-src 'self') blocks that script, so Driftline sends no analytics and logs a CSP violation on every load.

This adds script-src 'self' https://static.cloudflareinsights.com:

  • The injected tag carries an SRI integrity hash, so only Cloudflare's exact beacon build runs.
  • The snippet sets version and no send.to, so the beacon reports to same-origin /cdn-cgi/rum (checked in the beacon source, and drumsuit.chuangwangfu.com's traffic shows those requests). connect-src stays 'self'.

Pages preview URLs are outside the zone and never get the beacon, so this can only be observed on production after merge. Traffic per site can then be split with a Host filter in Web Analytics and in zone Analytics.

🤖 Generated with Claude Code

The chuangwangfu.com zone auto-injects the RUM beacon into every
subdomain; the CSP from #19 blocked it on Driftline. Allow its script
host; it reports to same-origin /cdn-cgi/rum, already covered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying driftline with  Cloudflare Pages  Cloudflare Pages

Latest commit: d39910b
Status: ✅  Deploy successful!
Preview URL: https://dc8adb4e.driftline-9vj.pages.dev
Branch Preview URL: https://feature-allow-web-analytics.driftline-9vj.pages.dev

View logs

@antigenius0910
antigenius0910 merged commit 6707781 into main Oct 29, 2026
2 checks passed
@antigenius0910
antigenius0910 deleted the feature/allow-web-analytics-beacon branch October 29, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant