tms/consent 问题修复 & 功能扩展

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

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

tms/consent

Composer 安装命令:

composer require tms/consent

包简介

Simple, lightweight and customizable consent manager for Neos CMS based on Klaro!

README 文档

README

Simple, lightweight and customizable consent manager for Neos CMS based on Klaro!

Let your users decide, which scripts should be loaded and executed while visiting your website.

IMPORTANT: We are developers, no lawyers. Using this package without further adaptation will most likely NOT result in GDPR, ePrivacy nor CCPA compliance!

Install

composer require tms/consent

What's included?

  • Klaro Script + opinionated Klaro Config (override or use your own anytime)
  • Klaro Config editing via Settings.yaml & predefined services
  • Klaro default styles & themes /Resources/Private/Styles/Theme
  • Placeholder for blocked content elements (Fusion Component + JS)
  • Consent settings button (Fusion Component + JS)
  • Overrides for common Neos packages /Resources/Private/Fusion/PresetPackages

Usage

Step 1: Service configuration via YAML settings

This package includes default consent management settings for the following services. Enable them in your Settings.yaml or add your own services.

  • Cloudflare
  • Matomo
  • Google Analytics
  • Google Maps
  • Youtube
# Example Tms.Consent configuration
Tms:
  Consent:
    config:
      # The privacy policy uri can be specified by node type, path, identifier or simply an absolute/relative link
      privacyPolicy: '#4999814e-61c2-4ce1-ab46-c1145f2285d7'
      
      # Enable the services you need consent management for
      services:
        matomo:
          enabled: true
          # Use the position key to render services in your favorite order
          position: 100
        youtube:
          enabled: true
          position: 200

Extend your services

Simply extend the YAML settings within your Neos package.

Tms:
  Consent:
    config:
      services:
        yourServiceName:
          enabled: true

          # -----------------------------------------------------------------
          # Klaro! Config
          # -----------------------------------------------------------------
          klaro:
            name: yourServiceName
            title: 'Your Service Title'
            description: 'Short description, why your website use this service...'
            purposes: ['functionality']

Think your service configuration is useful for others too? Don't hesitate to submit a PR. All the service related configuration should be combined in one settings file named like Settings.Consent.YourServiceName.yaml.

Step 2: Modify HTML

In order to control your configured services (e.g. to stop loading and/or execution without consent) it is necessary to modify the resulting HTML of your webpages.

This can be achieved by simply replacing some attributes - see https://github.com/KIProtect/klaro#managing-third-party-appstrackers

We try to provide preconfigured solutions for some common Neos packages, please have a look at /Resources/Private/Fusion/PresetPackages what we've already covered. Your package is missing? Submit a PR, if you think the service configuration could be useful for others.

Step 3: Verify

Check your site - have you blocked all your critical services?

(Optional) Step 4: Better UX for blocked content elements

This is an example how to use the Fusion Component for a Youtube + Bootstrap markup.

prototype(Your.Package:Component.Atom.Youtube) < prototype(Neos.Fusion:Component) {
    renderer = afx`
        <div class="embed-responsive embed-responsive-16by9">
            <Tms.Consent:Component.Atom.NoConsentPlaceholder serviceName="youtube" imageUri="" />
            <iframe src="about:blank" data-name="youtube" data-src="https://www.youtube-nocookie.com/embed/4DVD03IlXIs?wmode=transparent&amp;autoplay=&amp;controls=1&amp;rel=&amp;showinfo=" class="embed-responsive-item" loading="lazy" allowfullscreen="1"></iframe>
        </div>
    `
}

Wishlist

  • Add multi-site support
  • Backend module with some basic statistics on acceptance rate
  • User location based configurations

Any feedback, pull request or other contribution is very welcome!

Acknowledgments

Development sponsored by tms.development - Online Marketing and Neos CMS Agency

Webpack config inspired by https://github.com/neos/redirecthandler-ui

tms/consent 适用场景与选型建议

tms/consent 是一款 基于 SCSS 开发的 Composer 扩展包,目前已累计 1.32k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 12 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「cookie」 「third-party」 「neoscms」 「gdpr」 「ePrivacy」 「consent-management」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 tms/consent 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-26