Guide · Privacy
Cookieless Analytics: How It Works and What You Give Up
How cookieless web analytics counts visitors without cookies or local storage, what the daily hash method can and can't do, and how revenue is still attributed.
· 3 min read
Cookieless analytics counts visits without storing anything in the visitor's browser. No cookies, no local storage, no fingerprinting library. It's become popular because it avoids most consent-banner friction and counts the visitors who would otherwise decline. It also has real trade-offs. Here is how it works.
How do you count visitors without cookies?
A pageview carries a few things the server sees anyway: the page, the referrer, the browser's user agent and the IP address. Cookieless tools combine some of these into an id that's good enough for counting, then throw the raw data away.
The most common method, used by DataFair and other privacy-focused tools:
id = hash(secret salt of the day + website + IP address + user agent)
The salt changes every day, so ids can't be linked across days, and the IP address is never stored.
That gives you:
- Unique visitors per day, reasonably accurate
- Sessions and paths within the day
- Sources, pages, countries, devices, exactly as with cookies
What you give up
Being honest about the limits matters more than the marketing:
- Returning visitors. The id changes daily, so someone who visits on Monday and Thursday counts as two visitors. Weekly and monthly unique counts are higher than with cookies.
- Cross-day journeys. A visit on Monday can't be joined to a purchase on Thursday through the id alone.
- Shared networks. People on the same office or mobile network, using the same browser version, can be counted as one visitor that day.
Revenue attribution without cookies
Payments made the same day still match: in DataFair's cookieless mode, checkout links are tagged with that day's id, and window.datafair.attribution() returns it after the first pageview. So a visitor who reads a post and buys in the same sitting is credited correctly.
Payments on a later day fall back to other signals, such as an email the customer already used, or stay unattributed. If most of your customers buy days after their first visit, consider consent mode instead, which uses a cookie once the visitor agrees.
- 1DefaultA first-party cookie, for the longest journeys
- 2data-consent="required"Nothing until your banner calls datafair('consent', true)
- 3data-cookielessNothing stored in the browser, daily ids, same-day revenue matching
Turn it on
Add one attribute to the script tag:
<script defer data-cookieless data-website-id="YOUR_WEBSITE_ID" src="https://datafair.dev/js/script.js"></script>
Global Privacy Control signals are honoured by default, and you can exclude your own browser by visiting any page with ?df_ignore=true.
Do you still need a consent banner?
It depends on your jurisdiction and on what else your site does (ads, chat widgets and embeds may set their own cookies). Cookieless analytics removes analytics from the cookie question. It doesn't remove your other obligations. Check with your own adviser. Our GA4 and GDPR summary covers the background.
Comparing tools? See the best cookieless analytics tools.
Related guide: A Google Analytics alternative built around revenue.
Questions
- Is cookieless tracking the same as fingerprinting?
- No. Fingerprinting collects many device details to recognise a person over time. The daily hash method uses only the IP address and user agent, salts them with a secret that changes every day, and can't recognise anyone the next day.
- Why are my unique visitors higher in cookieless mode?
- Returning visitors count once per day instead of once per period, so weekly and monthly uniques rise. Daily numbers stay comparable.
- Can I switch between cookie and cookieless mode?
- Yes, it's one attribute on the script tag. Expect a step change in visitor counts on the day you switch.