承接 elgentos/magento2-consentmode-v2 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

elgentos/magento2-consentmode-v2

最新稳定版本:1.0.6

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

统计信息

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

GitHub 信息

  • Stars: 18
  • Watchers: 7
  • Forks: 8
  • 开发语言: HTML

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固