PHPackages                             syntro/silverstripe-google-analytics - 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. syntro/silverstripe-google-analytics

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

syntro/silverstripe-google-analytics
====================================

Adds Google Analytics to your page

1.0.1(4y ago)087[2 issues](https://github.com/syntro-opensource/silverstripe-google-analytics/issues)[2 PRs](https://github.com/syntro-opensource/silverstripe-google-analytics/pulls)BSD-3-ClausePHP

Since Mar 31Pushed 4y ago1 watchersCompare

[ Source](https://github.com/syntro-opensource/silverstripe-google-analytics)[ Packagist](https://packagist.org/packages/syntro/silverstripe-google-analytics)[ RSS](/packages/syntro-silverstripe-google-analytics/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (2)Dependencies (7)Versions (5)Used By (0)

Silverstripe Google Analytics
=============================

[](#silverstripe-google-analytics)

[![🎭 Tests](https://github.com/syntro-opensource/silverstripe-google-analytics/workflows/%F0%9F%8E%AD%20Tests/badge.svg)](https://github.com/syntro-opensource/silverstripe-google-analytics/actions?query=workflow%3A%22%F0%9F%8E%AD+Tests%22+branch%3A%22master%22)[![codecov](https://camo.githubusercontent.com/1c6caf1efaad93ecd12523c57414dba742f3bb9f635671d204e5c663c4fdb0a3/68747470733a2f2f636f6465636f762e696f2f67682f73796e74726f2d6f70656e736f757263652f73696c7665727374726970652d676f6f676c652d616e616c79746963732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/syntro-opensource/silverstripe-google-analytics)[![Dependabot](https://camo.githubusercontent.com/6a51b0751549261d7bac57cd594305fc5708bf907fc01b6f34aa97e914da4f6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646570656e6461626f742d6163746976652d627269676874677265656e3f6c6f676f3d646570656e6461626f74)](https://camo.githubusercontent.com/6a51b0751549261d7bac57cd594305fc5708bf907fc01b6f34aa97e914da4f6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646570656e6461626f742d6163746976652d627269676874677265656e3f6c6f676f3d646570656e6461626f74)[![phpstan](https://camo.githubusercontent.com/639cc050faeefad1a1d1ab830ca7a7950f1eede4402451b9a11cdc89d3a99066/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d73756363657373)](https://github.com/phpstan/phpstan)[![composer](https://camo.githubusercontent.com/2332cddc0dbd8a07866067fbd5290970d729831c86dfb08bbc84c4bc1aa2ba39/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73796e74726f2f73696c7665727374726970652d676f6f676c652d616e616c79746963733f636f6c6f723d73756363657373266c6f676f3d636f6d706f736572)](https://packagist.org/packages/syntro/silverstripe-google-analytics)[![Packagist Version](https://camo.githubusercontent.com/ac1d241d1836f90545e9fd994b2a979e2159bccf1f5f394fe78e4e7941dbbb19/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73796e74726f2f73696c7665727374726970652d676f6f676c652d616e616c79746963733f6c6162656c3d737461626c65266c6f676f3d636f6d706f736572)](https://packagist.org/packages/syntro/silverstripe-google-analytics)

Adds Google Analytics to your Website. Uses [`syntro/silverstripe-klaro`](https://github.com/syntro-opensource/silverstripe-klaro)for consent management.

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

[](#installation)

To install this module, run the following command:

```
composer require syntro/silverstripe-google-analytics

```

Usage
-----

[](#usage)

After installing, you have to configure analytics to use your datastream:

```
Syntro\SilverstripeGoogleAnalytics\Config:
  google_token: G-XXXXXXXX
```

After that, Silverstripe will serve Google Analytics after the user has given consent.

Configuration
-------------

[](#configuration)

You can use the following options on `Syntro\SilverstripeGoogleAnalytics\Config`to influence how the analytics script is loaded:

- `klaro_create_default_purpose`: if true, a new purpose will be created
- `klaro_purposes`: Add the created service to additional purposes. If 'klaro\_create\_default\_purpose' is true, the 'analytics' purpose will be appended.
- `klaro_enabled_by_default`: if true, the generated service will be enabled by default. **WARNING**: enabling this will most likely violate GDPR rules

Styling klaro!
--------------

[](#styling-klaro)

This Module uses klaro! for consent management via the [`syntro/silverstripe-klaro`](https://github.com/syntro-opensource/silverstripe-klaro)module. We recommend checking that module out for information on how to style the consent-window.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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

Total

2

Last Release

1505d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/289446336e84f3a201ac80def6e4a2a5289815d628ad5e0c0aa57b2f4bc20e73?d=identicon)[mleutenegger](/maintainers/mleutenegger)

---

Tags

silverstripesilverstripe 4

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/syntro-silverstripe-google-analytics/health.svg)

```
[![Health](https://phpackages.com/badges/syntro-silverstripe-google-analytics/health.svg)](https://phpackages.com/packages/syntro-silverstripe-google-analytics)
```

###  Alternatives

[cyber-duck/silverstripe-seo

A SilverStripe module to optimise the Meta, crawling, indexing, and sharing of your website content

4351.1k](/packages/cyber-duck-silverstripe-seo)[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)
