Skip to content

This Magento 2 module fixes issue #5596 (https://github.com/magento/magento2/issues/5596) affecting magento 2.1.x versions. This module enable Google Analytics tracking code when user allows cookies (Magento Cookie Restriction Mode enabled).

License

Notifications You must be signed in to change notification settings

keyurshah070/magento2-cookie-restriction-fix

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magento 2 Cookie Restriction Fix

In order to comply with European Cookie Law we have to enable Magento Cookie Restriction Mode.

By enabling Cookie Restriction Mode Magento 2.1.x does not show Google Analytics Tracking code even if user allow cookies.

This is due to bug #5596 (magento/magento2#5596) affecting magento 2.1.x versions.

This module fixes the issue and enable Google Analytics if user gives consent.

Not only Magento Google Analytics module benefits from this fix, but also every module using the standard Magento module Cookie.

Installation

Install module:

composer config repositories.magento2-cookie-restriction-fix git https://github.com/magma/magento2-cookie-restriction-fix.git
composer require magma/magento2-cookie-restriction-fix

Enable module:

./bin/magento setup:upgrade

Cookie Restriciton Mode and third-party modules

In order to comply with Cookie Law every third-party module should block tracking cookies unless the user accepts to save them.

Standard Magento Module Cookie Restriction Mode is meant to do so.

Third party developers can use this mechanism by checking the condition isUserNotAllowSaveCookie provided by the module Magento_Cookie.

Compatibility

Tested on Magento 2.1.8. It should work on older Magento 2.1.x versions.

Suggested modules

About

This Magento 2 module fixes issue #5596 (https://github.com/magento/magento2/issues/5596) affecting magento 2.1.x versions. This module enable Google Analytics tracking code when user allows cookies (Magento Cookie Restriction Mode enabled).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 87.1%
  • PHP 12.9%