Enabling Consent Management
To enable consent management, addwaitForConsent: true to your tracking script configuration:
How It Works
WhenwaitForConsent is enabled:
- Before Consent: Snitcher tracks pageviews and sessions, but visitor identity is not persisted across browser sessions.
- After Consent: Visitor identity persists across sessions, enabling cross-session recognition and attribution.
Even without consent, Snitcher still tracks pageviews and sessions—visitors just won’t be recognized when they return.
Automatic CMP Integration
Snitcher automatically integrates with these Consent Management Platforms:| CMP | Detection | Notes |
|---|---|---|
| Cookiebot | Automatic | Listens for consent events |
| OneTrust | Automatic | Integrates with OneTrust’s consent API |
| Transcend | Automatic | Detects Transcend consent signals |
- Detect when a visitor grants analytics or marketing consent
- Enable persistent visitor recognition
Manual Consent Handling
For custom cookie banners or other CMPs, you can manually grant consent:Example: Custom Cookie Banner
Checking Existing Consent
If a visitor has previously granted consent (stored in your own cookie/localStorage), grant consent on page load:Integration with Tag Managers
Google Tag Manager
Create a Custom HTML tag that fires when your consent trigger activates:Cookiebot via GTM
If using Cookiebot through GTM, create a trigger for theCookiebotOnAccept event:
Best Practices
- Load order matters: Ensure your CMP script loads before the Snitcher tracking script
- Test both scenarios: Verify tracking works both with and without consent
- Don’t over-complicate: If using a supported CMP, automatic integration should “just work”
Troubleshooting
Consent not being detected
Consent not being detected
- Ensure the CMP script loads before Snitcher
- Check browser console for CMP-related errors
- Verify the CMP is correctly configured
Visitors not being recognized across sessions
Visitors not being recognized across sessions
- Confirm
giveCookieConsent()was called - Check if localStorage is being cleared by the browser
- Verify consent was actually granted in your CMP
Data not appearing in dashboard
Data not appearing in dashboard
- Tracking still works without consent—just without cross-session recognition
- Check network requests to
radar.snitcher.comin DevTools