2017 © Pedro Peláez
 

silverstripe-module 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.

image

chrometoaster/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.

  • Monday, February 6, 2017
  • by michalkleiner
  • Repository
  • 8 Watchers
  • 0 Stars
  • 800 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 10 % Grown

The README.md

GA/GTM single-field

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., (*1)

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., (*2)

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., (*3)

Theme integration

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

<% include GA_GTM_head %> as close to the opening <head> tag as possible:, (*5)

<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:, (*6)

</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., (*7)

Changelog

For details of updates, bugfixes, and features, please see the changelog., (*8)

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.

The Versions

06/02 2017

dev-master

9999999-dev

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

  Sources   Download

BSD-3-Clause

The Requires

 

by Michal Kleiner

google silverstripe google analytics google tag manager gtm ga

06/02 2017

1.0.0

1.0.0.0

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

  Sources   Download

BSD-3-Clause

The Requires

 

by Michal Kleiner

google silverstripe google analytics google tag manager gtm ga