PHPackages                             gorriecoe/silverstripe-gtm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. gorriecoe/silverstripe-gtm

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

gorriecoe/silverstripe-gtm
==========================

A simple module that adds google tag manager snippets to silverstripe.

1.3.1(6y ago)010.5k↑50%2[2 PRs](https://github.com/gorriecoe/silverstripe-gtm/pulls)1BSD-3-ClausePHPCI failing

Since Mar 7Pushed 6y ago1 watchersCompare

[ Source](https://github.com/gorriecoe/silverstripe-gtm)[ Packagist](https://packagist.org/packages/gorriecoe/silverstripe-gtm)[ Docs](http://github.com/gorriecoe/silverstripe-gtm)[ RSS](/packages/gorriecoe-silverstripe-gtm/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (7)Used By (1)

Silverstripe google tag manager
===============================

[](#silverstripe-google-tag-manager)

A simple module that adds google tag manager snippets to silverstripe.

Installation
------------

[](#installation)

Composer is the recommended way of installing SilverStripe modules.

```
composer require gorriecoe/silverstripe-gtm

```

Requirements
------------

[](#requirements)

- silverstripe/cmframework ^4.0

Maintainers
-----------

[](#maintainers)

- [Gorrie Coe](https://github.com/gorriecoe)

Config
------

[](#config)

GTM will check if your `.env` file has defined `GTM_ID` first. As follows:

```
GTM_ID="GTM-123456"

```

If GTM\_ID has not been defined you can edit it in your CMS settings.

Options
-------

[](#options)

Define the tab to insert the gtm field into.

```
SilverStripe\SiteConfig\SiteConfig:
  gtm_tab: 'SomeTabName' // Defaults to 'Main'
```

Usage
-----

[](#usage)

Insert `$GTMscript` after the opening head tag and `$GTMnoscript` after the opening body tag.

```

	{$GTMscript}
	...

	{$GTMnoscript}
	...

```

[CSP - Content Security Policy](https://developers.google.com/tag-manager/web/csp)
----------------------------------------------------------------------------------

[](#csp---content-security-policy)

GTM checks for `getNonce()` method in the current controller. If its avaiable it will produce a CSP compatible snippet.

This means GTM is works with [Firesphere/csp-headers](https://github.com/Firesphere/silverstripe-csp-headers)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~153 days

Recently: every ~183 days

Total

6

Last Release

2220d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11811440?v=4)[Gorrie Coe](/maintainers/gorriecoe)[@gorriecoe](https://github.com/gorriecoe)

---

Top Contributors

[![gorriecoe](https://avatars.githubusercontent.com/u/11811440?v=4)](https://github.com/gorriecoe "gorriecoe (11 commits)")

---

Tags

googlesilverstripetagGoogle Tag Managergtm

### Embed Badge

![Health badge](/badges/gorriecoe-silverstripe-gtm/health.svg)

```
[![Health](https://phpackages.com/badges/gorriecoe-silverstripe-gtm/health.svg)](https://phpackages.com/packages/gorriecoe-silverstripe-gtm)
```

###  Alternatives

[silverstripe/tagfield

Tag field for SilverStripe

571.2M45](/packages/silverstripe-tagfield)[cyber-duck/silverstripe-google-tag-manager

Add Tag Manager data layer, events, and ecommerce support for SilverStripe

1528.0k](/packages/cyber-duck-silverstripe-google-tag-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
