Documentation

Cloudflare Web Analytics

Last updated May 10, 2026

Cloudflare Web Analytics is a cookieless analytics product configured through a single data-cf-beacon attribute on its loader. The cloudflareWebAnalytics() helper serializes your token and single-page application (SPA) preference into that attribute and hands the result to c15t's script loader.

Integrate with c15t

How c15t loads it

  • Category: measurement (Analytics)
  • Loads when: measurement consent is granted
  • On revocation: unloaded — c15t removes the script element from the DOM. Cloudflare Web Analytics is cookieless, so no client-side state needs clearing.

SPA route tracking is enabled by default. Disable it for traditional multi-page apps:

The helper JSON-encodes { token, spa } into the data-cf-beacon attribute that Cloudflare's loader reads at startup, matching Cloudflare's recommended embed.

Tracking events in your app

Cloudflare Web Analytics has no app-facing event API — the beacon tracks pageviews automatically once the script is loaded. There are no event calls in your application code to guard, so c15t's consent gating fully controls when and whether tracking happens.

Types

CloudflareWebAnalyticsOptions

Loading…

Script

Loading…