Download the PHP package chrometoaster/ga-gtm-singlefield without Composer
On this page you can find all versions of the php package chrometoaster/ga-gtm-singlefield. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chrometoaster/ga-gtm-singlefield
More information about chrometoaster/ga-gtm-singlefield
Files in chrometoaster/ga-gtm-singlefield
Package ga-gtm-singlefield
Short Description Adds single field to CMS settings section to hold GA or GTM code. Template snippets need to be inserted to theme templates manually.
License BSD-3-Clause
Informations about the package ga-gtm-singlefield
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.
Requirements
- SilverStripe 4.0 and above
Installation
Module
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:
Body
<% include Chrometoaster\GA_GTM\GA_GTM_body %>
directly after the opening <body>
tag:
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.
All versions of ga-gtm-singlefield with dependencies
silverstripe/framework Version ^4.0 || ^5.0
silverstripe/cms Version ^4.0 || ^5.0