Cloudflare Web Analytics offers free, cookieless tracking with no consent banner needed
A developer building a side project sought a way to measure site traffic without triggering GDPR cookie-consent requirements that come with tools like Google Analytics. Cloudflare Web Analytics emerged as a viable alternative, offering page views, referrers, geographic data, and Core Web Vitals without using cookies or cross-site fingerprinting. The tool can be set up automatically for Cloudflare-proxied sites or manually via a beacon snippet, including conditional loading in Next.js to exclude local development traffic. One notable pitfall is that a strict Content Security Policy can silently block the analytics beacon unless specific Cloudflare domains are whitelisted in both script-src and connect-src directives. While the cookieless approach removes the legal need for a consent banner, the developer recommends still disclosing its use in a site's privacy policy for transparency.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in