Sign inGet started
Tracking

Cookieless counting and consent

View as MarkdownOpen in ChatGPTOpen in Claude
Connect your agent
Add to CursorAdd to VS Code

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.

Before consentAfter a yes
Page views and eventsSentSent
Kept on the deviceNothing 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 daysCounted twiceCounted once
identify, group, setPersonPropertiesDo nothingWork

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 no

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.

Related
  • What the tag collects: Page views, clicks, forms, scroll, errors and page speed, counted without code. What never leaves the page.
  • Add the tag: Put one script line in the head of every page. Where it goes in plain HTML, site builders and each framework.
  • Custom events: Send your own events and orders, such as sign-ups, demo requests and purchases, with one line of JavaScript each, so revenue ties to the visit.
  • Identify people: Name signed-in people with identify, so their visits on every device make one profile your agent can read. It works only after the visitor's consent.
  • Subdomains, domains and Safari: Keep one visitor across your subdomains and your other domains, and stop Safari from forgetting returning visitors after 7 days.
  • Events from Google's dataLayer: The tag reads the events your site already pushes for Google Tag Manager, such as purchases and sign-ups.
Still have questions?
Was this page useful?