TraceLead stores nothing and sends nothing until consent exists (ADR-003, ADR-021). If your site uses one of the consent managers below, choose it as the site's consent manager preset and the snippet follows that manager's marketing category by itself: no code on your page. Otherwise, call tracelead('consent', …) from your own banner.
Consent manager presets
On your site's page in TraceLead, open Attribution settings → Consent manager and pick your CMP. The snippet then reads the CMP's state when the page loads and listens for changes: a visitor who accepts the category is attributed from that moment, one who rejects is not, and one who withdraws later has the stored first touch, last touch and visitor id deleted, exactly as with tracelead('consent', false). Until the CMP has a decision, nothing is stored.
| Preset | What the snippet reads | Category |
|---|---|---|
| Cookiebot | Cookiebot.consent.marketing once Cookiebot.hasResponse; events CookiebotOnConsentReady, CookiebotOnAccept, CookiebotOnDecline |
Marketing |
| OneTrust | OnetrustActiveGroups; event OneTrustGroupsUpdated |
Targeting cookies (C0004) |
| CookieYes | getCkyConsent() once the visitor has acted; event cookieyes_consent_update |
Advertisement |
| Complianz | cmplz_has_consent('marketing'); events cmplz_status_change, cmplz_enable_category, cmplz_revoke |
Marketing |
| iubenda | _iub.cs.api.getPreferences().purposes[5]; the onPreferenceExpressed, onConsentRead, onConsentRejected and onReady callbacks |
Marketing (purpose 5) |
| Usercentrics | V2: UC_UI.getServicesBaseInfo() (all services in marketing), UC_UI_INITIALIZED and the ucEvent window event; V3: UC_CONSENT with all accepted or all denied |
Marketing |
| Google Consent Mode | the latest gtag('consent', 'default' | 'update', …) in dataLayer |
ad_storage |
Why marketing and not statistics: the attribution record exists to tie a lead to the campaign that brought it, which consent managers class as marketing or advertising. If your privacy policy files it elsewhere, use your own call (below) with the category you have chosen.
Notes per manager:
- OneTrust:
C0004is OneTrust's default id for targeting cookies. If your categories use different ids, use your own call. - iubenda: iubenda announces choices only through callbacks in
_iub.csConfiguration, so place the TraceLead tag (or the queue stub and tag) before iubenda's script. Your own callbacks keep working. - Usercentrics V2: set Implementation → Data Layer & Events → Window Event Name to
ucEventso changes are picked up without a reload. With V3, a mixed choice inside the marketing category is read as no consent until the visitor accepts the whole category; use your own call if you need per-service decisions. - Google Consent Mode: defaults that carry a
regionare skipped, because the page cannot know the visitor's region; a default without a region and everyupdatecount. Any banner that sets Consent Mode works with this preset. - Complianz reports consent as granted in regions where it shows no banner; that is Complianz's decision for your configuration.
tracelead('diagnostics', console.log) shows cmp: { preset, detected, category }: detected: false means the CMP's browser API was not found on the page, and the snippet stays inert.
Presets do not detect anything on their own: with My own consent call (the default) the snippet ignores every CMP and waits for your call. A preset never loads the CMP's code.
Your own call
<script>
window.tracelead = window.tracelead || function () { (window.tracelead.q = window.tracelead.q || []).push(arguments); };
window.tracelead('consent', true); // storage for attribution permitted
window.tracelead('consent', false); // withdrawn: deletes the touch, visitor id and filled fields
</script>
Call it on every page once the visitor's choice is known: the snippet does not remember consent itself, your consent manager does. Calls queued before the snippet loads are replayed. A custom banner might look like this:
<script>
var saved = localStorage.getItem('my-consent'); // your own storage of the choice
if (saved === 'granted') window.tracelead('consent', true);
document.getElementById('accept').addEventListener('click', function () {
localStorage.setItem('my-consent', 'granted');
window.tracelead('consent', true);
});
document.getElementById('reject').addEventListener('click', function () {
localStorage.setItem('my-consent', 'denied');
window.tracelead('consent', false);
});
</script>
With Google Tag Manager, the call can live in its own Custom HTML tag; see Google Tag Manager.
Explicit vs assumed mode
Each site also has a consent mode in its attribution settings:
- Explicit (default): nothing is read or written until consent is signalled, by a preset or your call. The landing URL is parsed in memory on page load so a consent given later on the same page still captures the campaign.
- Assumed: the deployer declares that a legal basis exists (for example a site with no non-essential cookies that has obtained consent elsewhere). Storage starts immediately. You are responsible for that declaration. A preset's "rejected" still withdraws.
Checking it works
Open the hosted test form from the site page in your dashboard, or call tracelead.diagnostics() in the browser console: consentMode, consent, cmp and storage show whether the gate is open, which manager is followed and where the touch is kept. Nothing in that snapshot contains values or URLs.