Skip to content

kingfisherdirect/magento2-cookieconsent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cookie Consent for Magento 2 Integration

This Magento 2 module integrates the popular CookieConsent script into your Magento store, allowing you to comply with cookie consent regulations and enhance user privacy.

Important

Installation and using this module requires programming knowledge. This is nowhere near a module you'd expect for Magento 2. All configuration happens programmatically and there is no admin configuration at all!

Installation

composer require kingfisherdirect/magento2-cookieconsent
bin/magento setup:upgrade

Configuration

Note

This module requires Configuration / General / Web / Defalt Cookie Settings / Cookie Restriction mode to be disabled

Once module is installed you'll have to configure it with the services your website uses.

In order to do so, copy the config file into the theme dedicated to your website only.

cp vendor/kingfisherdirect/magento2-cookie-consent/view/frontend/web/js/cookieconsent.config.js app/design/YourCompany/YourTheme/KingfisherDirect_CookieConsent/web/js/

Then follow Configuration Reference to adjust configuration to make banner match your needs.

Making script respecting the choice made in banner is something that needs to be done manually and carefully. This is on per-script/service basis.

Google gtag

This module includes small change for Google gtag, since it's included by default in Magento and is commonly used. By default the consent is sent to denied as per consent mode documentation

gtag('consent', 'default', {
    'ad_storage': 'denied',
    'ad_user_data': 'denied',
    'ad_personalization': 'denied',
    'analytics_storage': 'denied',
    'wait_for_update': 500,
});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors