Skip to content

Cloudflare Web Analytics beacon is injected into every page and blocked by our CSP #418

Closed

Description

@neuromechanist

Cloudflare's edge injects its Web Analytics beacon (<script src="https://static.cloudflareinsights.com/beacon.min.js/...">) into every HTML response served to a browser, on both nemar.org and test.nemar.org. A plain curl does not show it; a browser-like User-Agent with Accept: text/html does. The site's CSP does not allow static.cloudflareinsights.com in script-src (or cloudflareinsights.com in connect-src), so the browser refuses it: the beacon has never run and has collected nothing. This predates the embed work.

Two costs. Every page logs a CSP "Refused to load" error in the console, seen in Chromium and WebKit while testing the embed (#415). And the embeddable viewer (#410) now puts that refused tag inside partner pages, while the docs and the privacy policy say the embed runs no analytics script. That statement is true, since it is blocked, but a partner reading devtools sees an analytics tag and an error.

Recommended fix (a Cloudflare setting, not code): turn off Web Analytics automatic setup or injection for the nemar.org zone and the two Pages projects (nemar-website, nemar-website-test). Then confirm with a browser-like request that the tag is gone. Not recommended: allowing the beacon in the CSP. That would add a third-party analytics script site-wide, which ADR 0019 and the published privacy policy do not cover. Part of #410's follow-ups.

Activity

  1. neuromechanist commented on Oct 5, 2026

    @neuromechanist
    ContributorAuthor

    Fixed by turning off Cloudflare Web Analytics automatic setup for the nemar.org site (the owner, 2026-10-05). One site covered the whole zone, site tag e03e09…, so docs.nemar.org got the beacon too. Checked with a browser-like request (Chrome User-Agent, Accept: text/html) about a minute later: nemar.org, www, app, test, docs and the test.nemar.org embed route now carry no cloudflareinsights script. *.pages.dev never had it. The beacon had never run, because the CSP blocked it, so no data was lost. The CSP is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions