PHPackages                             kreativsoehne/magento-2-google-analytics-opt-out - 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. [Security](/categories/security)
4. /
5. kreativsoehne/magento-2-google-analytics-opt-out

ActiveMagento2-module[Security](/categories/security)

kreativsoehne/magento-2-google-analytics-opt-out
================================================

Magento 2 extension to give customers the ability to opt-out Google Analytics tracking. Useful for european union's countries (GDPR)

1.0.0(7y ago)13MITHTMLPHP &gt;=7.0.0

Since Aug 2Pushed 7y agoCompare

[ Source](https://github.com/Kreativsoehne/magento-2-google-analytics-opt-out)[ Packagist](https://packagist.org/packages/kreativsoehne/magento-2-google-analytics-opt-out)[ Docs](https://www.kreativundsoehne.de/)[ RSS](/packages/kreativsoehne-magento-2-google-analytics-opt-out/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

magento-2-google-analytics-opt-out
==================================

[](#magento-2-google-analytics-opt-out)

Magento 2 extension to give customers the ability to opt-out Google Analytics tracking. Useful for european union's countries (GDPR)

installation
------------

[](#installation)

```
1. $ composer require kreativsoehne/magento-2-google-analytics-opt-out
2. $ ./bin/magento module:enable kreativsoehne_AnalyticsOptout
3. $ ./bin/magento cache:clean
4. Profit.

```

usage
-----

[](#usage)

After installing and activating, you can place a simple deactivation checkbox nearly everywhere you want.

This is how you do it for a CMS page:

```
Content -> Elements -> Pages ->

```

Reveal the Content part and switch Editor to markup mode. After that, place the following code anywhere you want.

```
 disable Google Analytics
{{block class="Magento\Framework\View\Element\Template" name="gaoptout" template="kreativsoehne_AnalyticsOptout::gaoptout.phtml"}}

```

Clear the cache

```
$ ./bin/magento cache:clean

```

and open up that page on the frontend wihin a browser. You are now able to check and un-check a checkbox which will result in Google Analytics not tracking you on that browser.

how it works
------------

[](#how-it-works)

This extension simply provides a small Template with some simple Java Script which can be placed anywhere via Magento's block feature. When checking the checkbox, a Java Script generates a cookie called "ga-disable-", which forces Google Analytics to stop collecting data. When un-checkig, the previously generated cookie will be deleted.

notice:
-------

[](#notice)

This Extension may not work in the future when new versions of google analytics with differend functionality appear.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2841d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/64e16a9472461b5fa92801e576b3a86535082d6a96bd3c6b30de95ef373bd9b1?d=identicon)[kreativsoehne](/maintainers/kreativsoehne)

---

Tags

googlemagentoanalyticscomposer-installergdprmagento 2dsgvooptoutopt-out

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kreativsoehne-magento-2-google-analytics-opt-out/health.svg)

```
[![Health](https://phpackages.com/badges/kreativsoehne-magento-2-google-analytics-opt-out/health.svg)](https://phpackages.com/packages/kreativsoehne-magento-2-google-analytics-opt-out)
```

###  Alternatives

[yireo/magento2-webp2

Magento 2 module to add WebP support to the Magento frontend

2091.2M7](/packages/yireo-magento2-webp2)[yireo/magento2-whoops

Magento 2 module adding Whoops error handling

102703.5k](/packages/yireo-magento2-whoops)[jfeltkamp/cookiesjsr

COOKiES JSR is a consent management tool and provides UI and API to manage 3rd party services within the GDPR.

27807.9k](/packages/jfeltkamp-cookiesjsr)

PHPackages © 2026

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