PHPackages                             magma/magento2-cookie-restriction-fix - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. magma/magento2-cookie-restriction-fix

ActiveMagento2-module

magma/magento2-cookie-restriction-fix
=====================================

Magento 2 module fixing Magento Cookie Restriction bug on Magento 2.1.x versions

1.0.0(8y ago)72522MIT LicenseJavaScriptPHP ~5.5.0|~5.6.0|~7.0.0

Since Sep 3Pushed 8y ago3 watchersCompare

[ Source](https://github.com/magma/magento2-cookie-restriction-fix)[ Packagist](https://packagist.org/packages/magma/magento2-cookie-restriction-fix)[ RSS](/packages/magma-magento2-cookie-restriction-fix/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (4)Used By (0)

Magento 2 Cookie Restriction Fix
================================

[](#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](https://github.com/magento/magento2/issues/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
------------

[](#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
-----------------------------------------------

[](#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
-------------

[](#compatibility)

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

Suggested modules
-----------------

[](#suggested-modules)

- [Fooman Google Analytics + (Magento 2)](https://marketplace.magento.com/fooman-googleanalyticsplus-m2.html)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

3

Last Release

3170d ago

Major Versions

0.0.2 → 1.0.02017-09-08

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66266171?v=4)[Magma](/maintainers/magma)[@magma](https://github.com/magma)

---

Top Contributors

[![fvanzani](https://avatars.githubusercontent.com/u/449348?v=4)](https://github.com/fvanzani "fvanzani (5 commits)")

---

Tags

cookiecookie-lawgoogle-analiticsgoogle-analyticsmagentomagento-cookiemagento2

### Embed Badge

![Health badge](/badges/magma-magento2-cookie-restriction-fix/health.svg)

```
[![Health](https://phpackages.com/badges/magma-magento2-cookie-restriction-fix/health.svg)](https://phpackages.com/packages/magma-magento2-cookie-restriction-fix)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
