Blog/Cookieless, GDPR-Friendly Analytics for React
Frontend

Cookieless, GDPR-Friendly Analytics for React

We counted about 2x more visitors after dropping cookie consent. Here is how cookieless analytics for React measures everyone, with no third-party trackers.

MS
Merse Sárvári, Founder, Statvisor
12 July 2026 · 7 min read

TL;DR

A GDPR-compliant cookie banner deletes most of your traffic, because only visitors who click accept get counted. Cookieless analytics set no identifier, so they need no banner for basic measurement and count everyone while collecting less.

Here is the quiet problem with the standard analytics setup: the compliant cookie banner you were told to add is deleting most of your data. Every visitor who clicks reject, or ignores the banner entirely, vanishes from your numbers. When we switched one React app off cookie-based analytics, the visitor count roughly doubled overnight. You are optimizing against a sample you cannot trust.

~2x
more visitors counted after we dropped cookie consent
Statvisor, from our own data
3 in 4
EU visitors we see decline or ignore the banner
Statvisor, from our own data
11.8%
of EU cookie banners meet the minimal legal requirements

A cookie-based tool only counts the visitors who click accept, and in Germany and France fewer than a quarter of them do. Add outright rejection, partial consent, and the third of visitors who ignore the banner entirely, and only around 40% of visits stay measurable. Your dashboard turns into a flattering view of the minority who said yes, and goes blind to the majority who did not.

Workspace with laptop showing a website and privacy settings
A compliant banner is honest. It is also expensive in lost data.

How Does Cookieless Analytics Change the Math?

Analytics that use no cookies and store no personal identifiers do not need the consent wall in the first place. Under the ePrivacy Directive, the trigger for consent is storing or reading information on a device, so measurement that sets no identifier and reads no cookie falls outside it for basic use. Check the EDPB guidance before you rely on this, then count everyone and collect less.

  • No third-party trackers loading on your visitors' browsers
  • No persistent identifier, so no consent prompt required for basic measurement
  • A lighter page, since you drop the tag-manager and cookie-sync payload
  • Numbers that reflect all traffic, not the fraction that clicked accept
Cookie-basedCookieless
Consent bannerRequiredNot required for basic measurement
Who gets countedOnly consenters (~40%)Every visitor
Page weightTag manager plus cookie syncOne small script
Identifier storedPersistent IDNone
The same page, measured two ways.

How Do You Add Cookieless Analytics to React?

The frontend component is a one-liner in your root layout. When you do need explicit consent for richer data, the banner is a drop-in too:

typescript
import { StatvisorAnalytics } from "@statvisor/sdk/react";
import { StatvisorConsentBanner } from "@statvisor/sdk/consent";

// cookieless real-user analytics
<StatvisorAnalytics frontendKey="vl_fe_..." />

// optional drop-in consent banner when you need it
<StatvisorConsentBanner frontendKey="vl_fe_..." />
React root layout with a one-line cookieless analytics component added
Measure the whole audience, ship a lighter page.

Statvisor analytics are cookieless and store no raw IP, so you see real visitor numbers and Web Vitals without dropping a consent wall on every first-time reader.

Some data genuinely requires opt-in. For where that line sits and how to handle visitor identity cleanly, read GDPR analytics: consent and the visitor ID problem, then fit it into the wider indie hacker monitoring stack. Building on Next.js? Wire it in via Next.js observability.

Ready to monitor your API in production?

Statvisor gives you latency percentiles, error rates, and request volume for every route, in minutes, not days.

Get started free →
MS

Written by

Merse Sárvári, Founder, Statvisor

Merse builds Statvisor and has spent years instrumenting JavaScript APIs and frontends for solo products and small teams.

Every post is written from hands-on experience building and running JavaScript apps, and reviewed for accuracy before publishing.