Skip to main content
Snitcher supports integration with popular Consent Management Platforms (CMPs) to help you comply with GDPR, CCPA, and other privacy regulations. To enable consent management, add waitForConsent: true to your tracking script configuration:
{
  "profileId": "YOUR_PROFILE_ID",
  "apiEndpoint": "radar.snitcher.com",
  "cdn": "cdn.snitcher.com",
  "namespace": "Snitcher",
  "waitForConsent": true
}
Without waitForConsent: true, Snitcher grants consent automatically on page load and visitor identity persists immediately—bypassing your consent flow.

How It Works

When waitForConsent is enabled:
  1. Before Consent: Snitcher tracks pageviews and sessions, but visitor identity is not persisted across browser sessions.
  2. 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:
CMPDetectionNotes
CookiebotAutomaticListens for consent events
OneTrustAutomaticIntegrates with OneTrust’s consent API
TranscendAutomaticDetects Transcend consent signals
If you use one of these CMPs, Snitcher will automatically:
  • Detect when a visitor grants analytics or marketing consent
  • Enable persistent visitor recognition
Just ensure your CMP script loads before the Snitcher tracking script.
For custom cookie banners or other CMPs, you can manually grant consent:
// Call this when your visitor accepts cookies
Snitcher.giveCookieConsent();
<div id="cookie-banner">
  <p>We use cookies to improve your experience. Do you accept?</p>
  <button id="accept-cookies">Accept</button>
  <button id="decline-cookies">Decline</button>
</div>

<script>
  document.getElementById('accept-cookies').addEventListener('click', function() {
    // Grant consent to Snitcher
    Snitcher.giveCookieConsent();

    // Hide the banner
    document.getElementById('cookie-banner').style.display = 'none';

    // Store preference (optional)
    localStorage.setItem('cookie_consent', 'granted');
  });
</script>
If a visitor has previously granted consent (stored in your own cookie/localStorage), grant consent on page load:
// Check your own consent storage
if (localStorage.getItem('cookie_consent') === 'granted') {
  Snitcher.giveCookieConsent();
}

Integration with Tag Managers

Google Tag Manager

Create a Custom HTML tag that fires when your consent trigger activates:
<script>
  if (window.Snitcher) {
    Snitcher.giveCookieConsent();
  }
</script>
Set this tag to fire on your consent-granted trigger (e.g., when a user accepts cookies).

Cookiebot via GTM

If using Cookiebot through GTM, create a trigger for the CookiebotOnAccept event:
<script>
  window.addEventListener('CookiebotOnAccept', function() {
    if (Cookiebot.consent.statistics && window.Snitcher) {
      Snitcher.giveCookieConsent();
    }
  });
</script>

Best Practices

  1. Load order matters: Ensure your CMP script loads before the Snitcher tracking script
  2. Test both scenarios: Verify tracking works both with and without consent
  3. Don’t over-complicate: If using a supported CMP, automatic integration should “just work”

Troubleshooting

  • Confirm giveCookieConsent() was called
  • Check if localStorage is being cleared by the browser
  • Verify consent was actually granted in your CMP
  • Tracking still works without consent—just without cross-session recognition
  • Check network requests to radar.snitcher.com in DevTools