PHPackages                             arillo/silverstripe-googleanalytics - 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. arillo/silverstripe-googleanalytics

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

arillo/silverstripe-googleanalytics
===================================

Silverstripe Google analytics

1.0.3(2y ago)0798↓40%1MITScheme

Since Jul 20Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/arillo/silverstripe-googleanalytics)[ Packagist](https://packagist.org/packages/arillo/silverstripe-googleanalytics)[ Docs](https://github.com/silverstripe-googleanalytics)[ RSS](/packages/arillo-silverstripe-googleanalytics/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (10)Used By (0)

arillo/silverstripe-googleanalytics
===================================

[](#arillosilverstripe-googleanalytics)

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

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

[](#requirements)

CMS versionBranch / versionSilverStripe CMS ^6`dev-master` (3.x-dev)SilverStripe CMS ^4 || ^5[`2.x`](https://github.com/arillo/silverstripe-googleanalytics/tree/2.x)SilverStripe CMS ^3[`1.x`](https://github.com/arillo/silverstripe-googleanalytics/tree/1.x)PHP ^8.3 for the SS6 line.

Setup
-----

[](#setup)

### Google analytics

[](#google-analytics)

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

```
# define in .env
AO_GA_TRACKING_CODE=""

```

Add the following into the `` section of your template:

```
$GoogleAnalytics

```

### Google analytics 4

[](#google-analytics-4)

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

```
# define in .env
AO_GA_TRACKING_CODE=""

```

Add the following into the `` section of your template:

```
$GA4

```

#### Customize

[](#customize)

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

### Google tag manager

[](#google-tag-manager)

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

```
# define in .env
AO_GTM_CODE=""

```

Add the following into the `` section of your template:

```
$GoogleTagManager(head)

```

After the opening `` tag:

```
$GoogleTagManager(body)

```

#### Customize

[](#customize-1)

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

Changelog
---------

[](#changelog)

3.x-dev (master)

- SS6 compatibility: `DataExtension` → `Core\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

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance60

Regular maintenance activity

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

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 ~356 days

Recently: every ~602 days

Total

9

Last Release

42d ago

Major Versions

0.0.2 → 1.0.02018-07-20

0.0.3 → 2.1.x-dev2020-08-07

1.0.3 → 2.x-dev2026-05-12

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1391103?v=4)[bumbus](/maintainers/bumbus)[@bumbus](https://github.com/bumbus)

![](https://avatars.githubusercontent.com/u/942999?v=4)[Arillo](/maintainers/Arillo)[@arillo](https://github.com/arillo)

---

Top Contributors

[![bumbus](https://avatars.githubusercontent.com/u/1391103?v=4)](https://github.com/bumbus "bumbus (10 commits)")

---

Tags

silverstripegoogle-analytics

### Embed Badge

![Health badge](/badges/arillo-silverstripe-googleanalytics/health.svg)

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

###  Alternatives

[cyber-duck/silverstripe-google-tag-manager

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

1528.1k](/packages/cyber-duck-silverstripe-google-tag-manager)[silverstripe/multi-domain

Allows multiple domains to access one CMS instance, mapping them to different sections of the hierarchy

141.6k](/packages/silverstripe-multi-domain)

PHPackages © 2026

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