Managing Consent for the Influ2 Tracking Pixel

Last updated: April 19, 2026

To comply with privacy laws like GDPR and CCPA, you control when the Influ2 tracking script loads based on user consent. This guide walks you through two approaches: using your cookie management platform or using Google Tag Manager.

Option 1: Consent-aware loading via your cookie management platform (CMP)

If you're using a cookie banner or consent management platform, wait for the user to grant consent before loading the Influ2 script.

How it works

Listen for a consent event from your CMP, then dynamically load the script only if marketing/analytics cookies are approved:

if (userConsentedToTracking) {
  var script = document.createElement('script');
  script.async = true;
  script.src = 'https://www.influ2.com/tracker?clid=YOUR-CLIENT-ID-HERE';
  document.head.appendChild(script);
}

Replace YOUR-CLIENT-ID-HERE with your actual Influ2 client ID (found in Settings > Account).

Examples with common platforms

OneTrust:

if (typeof OptanonActiveGroups !== 'undefined' && OptanonActiveGroups.includes('C0004')) {
  var script = document.createElement('script');
  script.async = true;
  script.src = 'https://www.influ2.com/tracker?clid=YOUR-ID-HERE';
  document.head.appendChild(script);
}

Cookiebot:

window.addEventListener('CookieConsentDeclaration', function() {
  if (Cookiebot.consents.marketing) {
    var script = document.createElement('script');
    script.async = true;
    script.src = 'https://www.influ2.com/tracker?clid=YOUR-ID-HERE';
    document.head.appendChild(script);
  }
});

Check your CMP's documentation for the exact event name or consent group that represents marketing/analytics cookies. The examples above are common but may vary by platform.

Option 2: Consent-aware loading via Google Tag Manager

If you're using GTM, create a tag that fires only after consent is given.

How it works

  1. Go to Create New Tag in your GTM container.

  2. Set Tag Type to Custom HTML.

  3. Paste the tracking script:

    <script async src="https://www.influ2.com/tracker?clid=YOUR-CLIENT-ID"></script>

  1. Under Triggering, select a consent-based trigger (e.g., a trigger that fires only after your CMP's consent event fires).

GTM also offers built-in Consent Mode if you've configured it. Use that if available.

  1. Save and publish the tag.

  2. Test it: Use GTM Preview to confirm the tag fires after consent is granted.

Stop tracking when consent is revoked

If a user withdraws consent, use this method to stop Influ2 from tracking immediately:

window.influ2.optOut();

This works without reloading the page and stops all data collection for that user.

Set up opt-out in Google Tag Manager

If using GTM:

  1. Create a new tag with Tag Type: Custom HTML.

  2. Paste:

    <script> window.influ2.optOut(); </script>

  1. Under Triggering, select the trigger that fires when your CMP sends a consent withdrawal signal (usually a custom event like consent_revoked or preferences_updated).

  2. Save and publish.

  3. Test in Preview mode to confirm the tag fires when consent is withdrawn.

Your CMP's documentation should specify the event name or callback for consent withdrawal. Work with your CMP provider or your web team to confirm the right event.

For help installing the tracking code itself (separate from consent), see Implementing the Influ2 Tracking Code Pixel.