toastnz/ga-gtm-singlefield 问题修复 & 功能扩展

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

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

toastnz/ga-gtm-singlefield

最新稳定版本:2.0.3

Composer 安装命令:

composer require toastnz/ga-gtm-singlefield

包简介

Adds single field to CMS settings section to hold GA or GTM code. Template snippets need to be inserted to theme templates manually.

README 文档

README

Adds support for a single-field configuration of GA/GTM code within the CMS.
Comes with Google snippets that need to be included in your theme's templates.

Requirements

  • SilverStripe 4.0 and above

Installation

Module

$ composer require chrometoaster/ga-gtm-singlefield

Alternatively, you can also install the module manually by placing a copy to the root folder of your site.

Run dev/build either via opening the url http://<your-host>/dev/build in a browser or by running the dev/build via a CLI.

Theme integration

Place two template includes into your theme's main template, e.g. Page.ss.

Head

<% include GA_GTM_head %> as close to the opening <head> tag as possible:

<head itemscope itemtype="http://schema.org/WebSite">
    <meta charset="utf-8">
    <title itemprop="name">$Title</title>

    <% include Chrometoaster\GA_GTM\GA_GTM_head %>

Body

<% include Chrometoaster\GA_GTM\GA_GTM_body %> directly after the opening <body> tag:

</head>
<body>
    <% include Chrometoaster\GA_GTM\GA_GTM_body %>

Usage

You will see a new 'GA & GTM' tab with a single field for a GA or GTM code under Settings in the CMS.
Insert a valid GA or GTM code and check if it's getting output to the resulting markup correctly.

Changelog

For details of updates, bugfixes, and features, please see the changelog.

TODO

  • Replace template includes with TemplateGlobalProvider or Controller function.
  • Investigate options for automatically inserting the necessary tags to the markup, e.g. extending the $MetaTags functionality or using Requirements backend.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2022-08-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固