Consent management
Connect Clakta to your cookie banner so it only saves an id in the visitor's browser after they agree.
In full attribution projects, the script saves an id in the visitor's browser, and in most countries that needs the visitor's consent. Clakta has a consent switch for this, so you can respect the visitor's choice without turning tracking off. In privacy-friendly projects nothing is saved, so there is nothing to switch.
What happens without consent
While consent is off, the script:
- Doesn't save or read any id in the browser
- Doesn't save the landing page
- Ignores
clakta.identify() - Still records page views and events, with anonymous same-day sessions
So without consent, the project behaves like a privacy-friendly one: you keep the traffic and same-day attribution, and only lose memory across visits.
Set the starting value
Pass consent to init() with what your banner already knows:
It is true by default. If your visitors have to opt in, set it to false and
turn it on when they accept.
Change it when the visitor decides
Call this from your banner's accept and reject buttons:
Refusing immediately deletes every id Clakta saved in the browser. You can check the current state at any time:
A complete example
Tracking starts right away either way: anonymous until the visitor accepts, identified after. You don't lose the visitors who never click the banner.
If nothing can be sent before consent
Some legal advice says nothing at all can be sent before consent. In that case,
remove data-auto-init from the script code and only start Clakta after the
visitor accepts:
This loses everything before consent, including the ad click that brought the
visitor. The clkt parameter is read from the first page they land on, so if
they leave that page before accepting, the attribution is gone. Use the consent
switch above unless you are required to do this.
Related articles
How Clakta tracking works
The path from an ad click to a sale in Clakta, step by step, and where to look when something is missing.
Tracking modes
Privacy-friendly or full attribution: what each mode collects, what it costs you, and what changes when you switch.
Track ecommerce events
Record product views, add to cart, checkout started and payment submitted from your site, to see where visitors give up before buying.