Skip to content
Docs
Browse Data Capture

Consent

How the tag behaves before and after a visitor answers your consent banner, and how to wire it up.

The default

Unless you tell it otherwise, the tag treats every visitor as consenting. If your visitors must agree before they are measured, set the tag to wait for an answer and connect your consent banner to it.

Kontala does not read consent management platforms such as OneTrust or Cookiebot on its own. Your site tells the tag what the visitor chose.

Wait for an answer

Add data-consent="unknown" to the script tag:

<script async src="https://konta.la/v1/t.js?k=pk_live_..." data-consent="unknown"></script>

While consent is unknown:

  • The tag writes no cookies.
  • It holds the page's events for up to 10 seconds, waiting for an answer. Set data-consent-hold to change the wait, in milliseconds.
  • If no answer comes, page views are sent without any identifying details, and clicks, scrolling and friction are dropped.

Tell the tag what the visitor chose

When the visitor answers your banner:

window.pageTracker.consent('granted'); // or 'denied'

Before the tag has loaded, queue the answer instead:

window.pageTrackerQueue = window.pageTrackerQueue || [];
window.pageTrackerQueue.push(['consent', 'granted']);

window.pageTracker.getConsent() returns the current state.

What each state means

StateCookiesWhat is kept
grantedWrittenEverything you turned on
unknownNonePage views without any identifying details, and nothing else
deniedNone, and nothing is stored on the devicePage views without any identifying details, and nothing else

Without granted consent, Kontala removes the device and session ids, the user, the IP address and location, the browser, the page URL and referrer, and the data layer, before the event is stored. Those events are left out of Analytics.

Shopify

The Shopify pixel follows the store's own customer privacy settings.

Browser signals

The Global Privacy Control and Do Not Track headers are recorded with each event, but the tag does not act on them. If you want to honour them, read them in your own code and pass denied.

Was this helpful?