collab/module-consent-mode

Cookie Consent Mode Popup Extension for Magento 2

Installs: 944

Dependents: 0

Suggesters: 0

Security: 0

Stars: 10

Watchers: 3

Forks: 1

Open Issues: 0

Language:HTML

Type:magento2-module

1.0.4 2024-09-06 22:05 UTC

This package is auto-updated.

Last update: 2024-11-07 20:34:50 UTC


README

The Collab_ConsentMode module extends native Magento_Cookie module in following ways:

  • if Collab_ConsentMode is enabled and Cookie Restriction Mode is set to "Yes" native consent popup is extended with additional checkboxes (for user preferences) and additional buttons which will let them save theirs preferences.

The Collab_ConsentMode module works in following way:

  • by default (when user visitis the page for the first time) we are presenting the user with the consent popup
  • on initial visit gtag is fired with following options, those options are saved in the local storage
gtag('consent', 'default', {
    'ad_storage': 'denied',
    'ad_user_data': 'denied',
    'ad_personalization': 'denied',
    'analytics_storage': 'denied'
})

Please mind that this initialization needs to be done as soon as possible (at least before GTM script is fired) so we are loading gtag's template (block name consent.initializer) in head.additional block with before="-" argument. If Your project is using customized layout please make sure that consent.initializer is first block in Yours head.additional block or it is placed at least before GTM init script.

  • if user changes his preferences, we are firing gtag with new options and saving them in the local storage
  • if user visits the page again, we are checking if there are any preferences saved in the local storage and if so we are just using them
  • user has an ability to change his preferences at any time by visiting CMS Page with the consent form (module is shipped with dedicated widget for that)

Configuration

You can configure the module in the admin panel under Stores > Configuration > Collab Extensions > Google Consent Mode v2.

Installation details

composer require collab/module-consent-mode
bin/magento setup:upgrade

Screenshots

Consent Widget Embeded in CMS Page