Implementing Custom Consent Management with HandL UTM Grabber Plugin

UTM attribution overview

This guide explains Implementing Custom Consent Management with HandL UTM Grabber Plugin. It helps you respect consent choices while preserving UTM parameters for compliant WordPress attribution and keep the marketing context needed for accurate reporting across forms, bookings, signups, and sales.

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

Revision #1
Created 16 December 2024 16:15:24 by Leman
Updated 18 May 2026 14:54:54 by Leman