arillo/silverstripe-googleanalytics 问题修复 & 功能扩展

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

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

arillo/silverstripe-googleanalytics

最新稳定版本:1.0.3

Composer 安装命令:

composer require arillo/silverstripe-googleanalytics

包简介

Silverstripe Google analytics

README 文档

README

Adds google analytics tracking script to your site, if it is in production (live) mode.

Requirements

CMS version Branch / version
SilverStripe CMS ^6 dev-master (3.x-dev)
SilverStripe CMS ^4 || ^5 2.x
SilverStripe CMS ^3 1.x

PHP ^8.3 for the SS6 line.

Setup

Google analytics

To make it work, you have to define AO_GA_TRACKING_CODE environment variable.

# define in .env
AO_GA_TRACKING_CODE="<YOUR_GA_TRACKING_CODE>"

Add the following into the <head> section of your template:

$GoogleAnalytics

Google analytics 4

To make it work, you have to define AO_GA4_TRACKING_CODE environment variable.

# define in .env
AO_GA_TRACKING_CODE="<AO_GA4_TRACKING_CODE>"

Add the following into the <head> section of your template:

$GA4

Customize

You can overwrite GoogleAnalytics.ss (or GA4.ss) on project basis, if you need some different behaviour.

Google tag manager

To make it work, you have to define AO_GTM_CODE environment variable.

# define in .env
AO_GTM_CODE="<YOUR_GTM_CODE>"

Add the following into the <head> section of your template:

$GoogleTagManager(head)

After the opening <body> tag:

$GoogleTagManager(body)

Customize

You can overwrite GoogleTagManager.ss on project basis, if you need some different behaviour.

Changelog

3.x-dev (master)

  • SS6 compatibility: DataExtensionCore\Extension, explicit framework ^6 / cms ^6 constraints
  • Template fix: quoted bareword string comparisons (== 'head', == 'body') for SS6 template strictness

2.x

  • SS4 + SS5 compatibility line (frozen)

1.0.2

  • added GA4

1.0.1

  • added GTM

1.0.0

  • SS4 compat

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 1
  • 开发语言: Scheme

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-07-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固