Skip to main content

Cloudflare Analytics: Analytics Without Cookies

Cloudflare · 19.04.2026 · 5 min read
Illustration for “Cloudflare Analytics: Analytics Without Cookies”

Cloudflare offers two types of analytics: the built-in Dashboard analytics (data from the CDN) and Cloudflare Web Analytics (a separate product with a JS tracker). Both are free and do not use cookies.

Built-in Cloudflare Dashboard Analytics

Analytics → Traffic. Shows:

  • Requests — total number of HTTP requests
  • Bandwidth — traffic volume
  • Cache Hit Rate — percentage of requests served from cache
  • Threats blocked — blocked threats
💡 Data in the Cloudflare Dashboard is server-side analytics. It sees all users, including those who block JavaScript and trackers.

Cloudflare Web Analytics (Free)

Analytics → Web Analytics → Add a site. Add a lightweight JS tracker to your site:

<script defer src='https://static.cloudflareinsights.com/beacon.min.js' 
        data-cf-beacon='{"token": "your_token"}'></script>

What Web Analytics Shows

MetricCloudflare AnalyticsGoogle Analytics 4
Pageviews✅✅
Unique visitors✅ (approximate)✅
Core Web Vitals✅ (real data)✅
Conversions❌✅
Funnels❌✅
Cookies❌ None⚠️ Cookie
GDPR✅ No consent needed⚠️ Banner required
✅ Cloudflare Web Analytics is a great complement to GA4 or a standalone solution for simple sites. It does not require a GDPR cookie banner.
⚠️ Web Analytics does not provide data for remarketing, detailed user behavior, or goal configuration. Serious marketing needs GA4.

GraphQL Analytics API

Both analytics types are available through the GraphQL API — useful when you need to export data into an external reporting system. The request needs an API Token with Analytics:Read permission. The same token also works for automation through the API and Terraform:

curl -X POST "https://api.cloudflare.com/client/v4/graphql" \
  -H "Authorization: Bearer $CF_API_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"query":"query { viewer { zones(filter: {zoneTag: \"ZONE_ID\"}) { httpRequests1dGroups(limit: 7) { dimensions { date } sum { requests } } } } }"}'

The response comes back as JSON with ready-made daily aggregates — no need to parse raw logs.

Common Web Analytics problems

The counter shows zero visits

Check that the beacon.min.js script actually loads on the page (Network tab in DevTools, filter by cloudflareinsights.com). Common causes of missing data: a wrong data-cf-beacon token, the script sitting in a cached static version of the page that was never purged, or a Content-Security-Policy blocking the static.cloudflareinsights.com domain.

Numbers do not match Google Analytics

A 10-20% gap is normal. Web Analytics does not use cookies and cannot deduplicate a visitor across devices or sessions the way GA4 does with a client ID. On top of that, GA4 loses part of the traffic to ad blockers and browser privacy settings, while Web Analytics does not, since it needs no cookie consent.

Verifying the tracker works

# In the browser console on the site page:
document.querySelector('script[data-cf-beacon]')

# Or via the Network tab: there should be a request
# GET https://cloudflareinsights.com/cdn-cgi/rum with a 204 status

If the request returns 204 No Content, the tracker is working — data will appear in the Dashboard within a few minutes. The site must already be connected to Cloudflare — see the guide on connecting a site.

When built-in analytics is not enough

  • You need sales funnels and conversion events — use GA4 or Plausible/Matomo alongside Web Analytics.
  • You need audience segmentation by traffic source for remarketing — Web Analytics does not store this data.
  • You need a historical export of raw request logs — that requires Logpush (not available on every plan) or a third-party logging service.

Data in the built-in Dashboard analytics is kept for a limited period that depends on the plan — for long-term statistics, export the aggregates through the GraphQL API into your own storage (a database or BigQuery) rather than relying only on the history shown in the interface.

Another common mistake is pasting a data-cf-beacon token from a different domain, copied from an older project by mistake. The token is tied to a specific site under Web Analytics → Add a site, and data sent with the wrong token simply never lands in the right report, with no visible error in the browser.

To quickly compare load before and after changes on the site, use the date filter in Dashboard → Web Analytics — the same screen lets you export a CSV of visits by page for a client report.

Web Analytics can also be enabled without manually adding a beacon script to every page — if the site is already proxied through Cloudflare (Proxied DNS), turning on automatic tag insertion in the Dashboard is enough, and it appears in every HTML response on its own, with no template edits needed.

Was this article helpful?
← Back to Knowledge Base Ask Support