kreativsoehne/magento-2-google-analytics-opt-out 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

Composer 安装命令:

composer require 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)

README 文档

README

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

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

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 -> <edit page>

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

<p><input class="ga-optout" type="checkbox" /> disable Google Analytics</p>
<p>{{block class="Magento\Framework\View\Element\Template" name="gaoptout" template="kreativsoehne_AnalyticsOptout::gaoptout.phtml"}}</p>

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

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:

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

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固