The Home for Magento 2 Excellence

Quality-tested Magento 2 modules. Explore. Evaluate. Elevate. #magento2

539 Modules
305 Ready
196 Need Help
🏆 Leaderboard
Stable vv1.1.0

Simple Cookie Consent module for Magento

maisondunet/module-gtm-cookie-consent

Integrates Google Tag Manager (GTM) with a cookie consent solution. Manages user cookie consent preferences and triggers GTM events based on consent.

4,109
Downloads
Below average
10
GitHub Stars
Below average
8mo ago
Last Release
1
Open Issues
Not Tested
Awaiting results

Build Tests

Composer Install
DI Compile
Templates

Code Quality

Coding Standard
PHPStan

Recent Test History

Each release is tested against the latest Magento version at that time.

No test history available yet.

Share This Module's Status

Simple Cookie Consent module for Magento Magento compatibility status badge

README

Loaded from GitHub

Simple Cookie Consent module for Magento built around new consent feature of GTM

This module is a wrapper for cookie-consent by 68publishers for easy cookie consent management withGoogle Tag Manager

  • :white_check_mark: Easy configuration
  • :white_check_mark: Five configurable storages standardized by Google
  • :white_check_mark: Possibility to trigger custom GTM event on the consent

Integration with GTM

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)

Installation

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

Module configuration is located at :

Stores > Configuration > General > Cookie Consent

Global Options

| Field | Description | |-------------------------------------|--------------------------------| | Enable Module | Enable / Disable the module |

Plugin Options

| 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 |

Auto Clear Option

| Field | Description | |-------------------------------------|------------------------------------------------------------| | Enable Module | Automatically clear cookie when the user remove it consent |

Storage Options

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 |

Advanced Options

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 |

Development

Since v1.1.0, this module use a fork of cookie-consent by 68publishers available at https://github.com/MdnAgency/gtm-cookie-consent This fork customizes the translation loader for easier integration with magento.

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.