elgentos/magento2-consentmode-v2 问题修复 & 功能扩展

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

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

elgentos/magento2-consentmode-v2

Composer 安装命令:

composer require elgentos/magento2-consentmode-v2

包简介

Consent Mode V2 magento extension for the Hyva theme

README 文档

README

This extension is based on the Hyva default cookie bar. All features that are in that extension are in this one.

Main Functionalities

This extension:

  • Overrides the default Hyva cookie bar
  • Sets default consentMode

gtag('consent', 'default', { 'ad_storage': 'denied', 'ad_user_data': 'denied', 'ad_personalization': 'denied', 'functionality_storage': 'denied', 'personalization_storage': 'denied', 'security_storage': 'denied', });

  • This fires the GTM build in trigger like this:

build-in-trigger.png

  • shows banner when consentMode is not set in localstorage or isUserAllowedSaveCookieName (default magento cookie) is null

banner.png

  • You can click 3 buttons
    • Deny: routes you to the noCookies url you can set in the backend
    • Customize: set the cookies you selected above
    • Allow All: All cookies are allowed (all checkmarks are set)

Logic behind this:

{
    'functionality_storage': consent.necessary ? 'granted' : 'denied',
    'security_storage': consent.necessary ? 'granted' : 'denied',
    'personalization_storage': consent.preferences ? 'granted' : 'denied',
    'analytics_storage': consent.statistics ? 'granted' : 'denied',
    'ad_storage': consent.marketing ? 'granted' : 'denied',
    'ad_user_data': consent.marketing ? 'granted' : 'denied',
    'ad_personalization': consent.marketing ? 'granted' : 'denied',
};
  • When gtag consent default is set, an event is fired in GTM called: default When the settings are changed, the update event is fired.

As you can see in this example:

consent-example.png

  • It adds a button on the absolute bottom of the page so you can always open the cookie settings (this is intentionally not fixed on the viewport)

Would be nice to have multiple events on multiple levels of consent you can add in GTM.

Installation

  1. Install the package into your repository using composer.
composer require elgentos/magento2-consentmode-v2
  1. Enable the Magento module.
bin/magento module:enable Elgentos_ConsentModeV2

Configuration

  1. Enable the module in the Magento backend.
    • Navigate to "Stores → Configuration → Extensions → Elgentos → Consent Mode V2".
    • Set the option "Enabled" to yes.

img.png

  1. Turn on "Cookie Restriction Mode".
    • Navigate to "Stores → Configuration → General → Web → Default Cookie Settings → Cookie Restriction Mode"
    • Uncheck "Use system value" and set the option "Cookie Restriction Mode" to "Yes".

img_1.png

elgentos/magento2-consentmode-v2 适用场景与选型建议

elgentos/magento2-consentmode-v2 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 29.22k 次下载、GitHub Stars 达 20, 最近一次更新时间为 2024 年 05 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 elgentos/magento2-consentmode-v2 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 elgentos/magento2-consentmode-v2 我们能提供哪些服务?
定制开发 / 二次开发

基于 elgentos/magento2-consentmode-v2 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 29.22k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 20
  • 点击次数: 29
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 20
  • Watchers: 8
  • Forks: 8
  • 开发语言: HTML

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2024-05-29