Enforce Consent From 3rd Party (e.g. GTM)

Overview

Enabling the Feature

To enable this feature:

  • Navigate to your WordPress admin panel.
  • Go to the HandL UTM Grabber settings page.
  • Find the "Require Third-Party Consent" option.
  • Check the box next to "Require consent from third-party services (e.g., Google Tag Manager) before tracking".
  • Save your changes.

The relevant setting can be found here:

How It Works

Once enabled, HandL UTM Grabber will:

  • Monitor the dataLayer for consent update events.
  • Check the consent status before running its tracking functions.
  • Remove HandL cookies if consent is denied.

The main logic for this feature is implemented in the following JavaScript functions:

isConsentDenied();
removeHandLCookies();

You may use these functions as you see fit in your project. The isConsentDenied() function returns a Boolean value indicating whether consent is denied. The removeHandLCookies() function removes all HandL-related cookies (e.g., when consent is denied).

The plugin checks for consent using the getConsentStatus() and isConsentDenied() functions. These functions look for consent information in the dataLayer object, which is commonly used by consent management platforms.

Integration with Google Tag Manager (GTM)

To use this feature with Google Tag Manager:

Compatibility

This feature is designed to work with various consent management platforms that use the dataLayer to communicate consent status. It has been tested with Google Tag Manager but should be compatible with other similar systems.

Troubleshooting

If you're experiencing issues with this feature:

  • Ensure that your consent management platform is correctly updating the dataLayer.
  • Check your browser's console for any error messages related to HandL UTM Grabber.
  • Verify that the "Require Third-Party Consent" option is enabled in the HandL UTM Grabber settings.

Important Notes

  • This feature relies on the presence and proper configuration of a third-party consent management system.
  • If no consent information is found in the dataLayer, HandL UTM Grabber will default to its standard behavior.
  • Enabling this feature may impact data collection if users do not provide consent.

By implementing this feature, you're taking an important step towards respecting user privacy and complying with data protection regulations.

Never lose any UTMs ever 💪

Get HandL UTM Grabber V3