← All docs

Consent setup (GDPR & PECR)

How the snippet stays silent until your cookie banner says yes.

Trackfully is consent-first: until the page signals consent, the snippet writes no cookies, no localStorage, and captures nothing. That's the PECR-compliant default — not an option you switch on.

Signal consent

Two equivalent ways:

Before the snippet loads (if your banner state is known at page render):

<script>window.trackfullyConsent = true;</script>
<script async src="https://trackfully.vercel.app/t.js" data-site-key="tf_…"></script>

When the user accepts (from any cookie banner's accept callback):

trackfully('consent', true);

Consent persists across pages for that visitor, so you only need to signal it once.

Withdrawing consent

If your banner lets users change their mind, pass false:

<script>window.trackfullyConsent = false;</script>

on the next page load clears the stored consent and stops all capture.

Opting a form out

Any form you never want captured (e.g. a login form):

<form data-trackfully="off">…</form>

What's stored, where

With consent: a first-party visitor id (cookie + localStorage), the visitor's first and last marketing touch, and a session marker. All data is processed and stored in London (UK). Nothing is shared with ad networks.