Implementing Custom Consent Management with HandL UTM Grabber Plugin

To integrate your custom consent management system with the HandL UTM Grabber plugin, follow these steps:

Here is an example implementation using JavaScript:

window.addEventListener('ConsentUpdated', function() {
    if (typeof ConsentTool !== 'undefined') {
        const consentString = Cookies.get('CookiesForConsentData');

        // Assuming consent data is available in cookies or as an event
        const consentData = parseConsentString(consentString);

        if (consentData.good2go === 1) {
            RunHandL();
        } else {
            removeAllHandLCookies();
        }
    }
});

function parseConsentString(consentString) {
    // Parse the consent string to extract consent data
    // This is a placeholder function, implement the actual parsing logic as needed
    return {
        good2go: consentString.includes('good2go=1') ? 1 : 0
    };
}

Explanation

  1. Event Listener: The window.addEventListener listens for a custom event CustomConsentUpdated which is triggered by your consent management system.
  2. Check Consent Management System: Ensure that the custom consent management system is available.
  3. Get Consent Status: Retrieve the consent status from event or cookies.
  4. Run or Remove Cookies: Depending on the consent status, either run the RunHandL() function or call removeAllHandLCookies() to remove all cookies

Never lose any UTMs ever 💪

Get HandL UTM Grabber V3