Cookieless counting and consent
The tag counts without cookies until a visitor agrees. How consent works, from your banner or your code.
Updated
By default, the tag doesn't wait for your cookie banner to start counting, and it doesn't need cookies to do it. Until a visitor agrees, it counts cookieless: it sends page views and events, but keeps nothing on the device across visits and identifies nobody. A visitor is counted with a code that changes every day.
Here's what changes when they say yes, and how to tell the tag.
What changes after consent?
| Before consent | After a yes | |
|---|---|---|
| Page views and events | Sent | Sent |
| Kept on the device | Nothing across visits (the visit lives in the tab only) | A first-party id, na_id, on your site's domain, for 13 months (subdomains, domains and Safari) |
| Same person on two days | Counted twice | Counted once |
identify, group, setPersonProperties | Do nothing | Work |
A no removes everything the tag kept in the tab, on the device and in its cookie. A browser sending Global Privacy Control always counts as no.
What about Do Not Track and Global Privacy Control?
A visitor whose browser sends Do Not Track or Global Privacy Control isn't recorded at all, even after consent(true). Their visits don't appear in your numbers.
How do you tell the tag the answer?
From your code, where your banner's answer is handled:
window.nextanalytica.consent(true); // the visitor agreed
window.nextanalytica.consent(false); // the visitor said noCan the tag wait for consent instead?
Yes. To send nothing at all until a yes, add data-cookieless="off" to the line:
<script async src="https://t.nextanalytica.app/t.js" data-project="na_…" data-cookieless="off"></script>Events then wait in memory, never on the device, and go when the visitor agrees.