dorsetdigital/silverstripe-simplegtag

添加 GTM 标签的简单方法

安装: 330

依赖项: 0

建议者: 0

安全: 0

星标: 1

关注者: 3

分支: 0

开放问题: 0

类型:silverstripe-vendormodule

v2.0.2 2024-07-10 06:04 UTC

This package is auto-updated.

Last update: 2024-09-10 06:26:43 UTC


README

一种非常简单的方法,用于向网站添加 Google 标签,用于分析、广告等。

Scrutinizer Code Quality Build Status License Version

要求

*Silverstripe 4.x

安装

  • 使用 composer require dorsetdigital/silverstripe-simplegtag 安装代码
  • 运行 dev/build?flush 以更新您的项目

使用方法

此模块将所需的代码注入到您的页面中,用于 Google Tag Manager。安装后,请在网站配置中设置您的 GTM ID。

该模块在 <head> 中注入代码,并在 <body> 开始处注入 <noscript> 片段。

同意

如果您使用的是cookie同意模块(https://github.com/TheBnl/silverstripe-cookie-consent),则此模块仅在用户接受分析cookie的情况下添加 GTM 标签。