This module is a wrapper for cookie-consent by 68publishers for easy cookie consent management withGoogle Tag Manager
- ✅ Easy configuration
- ✅ Five configurable storages standardized by Google
- ✅ Possibility to trigger custom GTM event on the consent
This module leverage the new consent functionality of Google Tag Manager (see GTM Consent documentation for more information)
The consent functionality isn't enabled by default in GTM therefore you need to manually enable that feature in your Google Tag Manager dashboard. (see GTM documentation)
To install the Magento 2 GTM Cookie consent, simply run the command below:
composer require maisondunet/module-gtm-cookie-consent
To enable the module:
bin/magento module:enable Maisondunet_CookieConsent
Module configuration is located at :
Stores > Configuration > General > Cookie Consent
Field | Description |
---|---|
Enable Module | Enable / Disable the module |
Field | Description |
---|---|
Cookie Name | Name of the cookie used to store user consent |
Force user consent | Block the UI until user action |
Manage page script | Managed inline script (see cookie-consent documentation |
Field | Description |
---|---|
Enable Module | Automatically clear cookie when the user remove it consent |
Storages descritpions are described in GTM documentation
Field | Description |
---|---|
Enable by Default | This storage is enable by default |
Display in widget | This storage visible in setting popup |
Read only | Deny the user to change the default value |
This functionality allow the administrator to tigger custom GTM event on user consent.
ie :
Event Name | Storages | Operator | Result |
---|---|---|---|
fb_pixel_event | Ads, Analytics | And | GTM event "fb_pixel_event" is trigger when user give consent for Ads and Analytics storages |