PHPackages                             wakeworks/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. wakeworks/analytics

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

wakeworks/analytics
===================

A privacy focused analytics module integrated into Silverstripe

2.0.1(1y ago)6313[4 issues](https://github.com/wakeworks/Analytics/issues)BSD-3-ClausePHPCI failing

Since Feb 11Pushed 1y ago3 watchersCompare

[ Source](https://github.com/wakeworks/Analytics)[ Packagist](https://packagist.org/packages/wakeworks/analytics)[ RSS](/packages/wakeworks-analytics/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (6)Versions (12)Used By (0)

Analytics for Silverstripe
==========================

[](#analytics-for-silverstripe)

[![Packagist Version](https://camo.githubusercontent.com/d8515f2865436854ddbd4bc87ea51b492857fcbb0df109466bc57d3bfb742920/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77616b65776f726b732f416e616c79746963733f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/d8515f2865436854ddbd4bc87ea51b492857fcbb0df109466bc57d3bfb742920/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77616b65776f726b732f416e616c79746963733f7374796c653d666c61742d737175617265)[![GitHub](https://camo.githubusercontent.com/0fa4c430cb6b600a2b26e9befd6a91407424bf8a6e9e963c137786ed40061740/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77616b65776f726b732f416e616c79746963733f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/0fa4c430cb6b600a2b26e9befd6a91407424bf8a6e9e963c137786ed40061740/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77616b65776f726b732f416e616c79746963733f7374796c653d666c61742d737175617265)[![Scrutinizer code quality (GitHub/Bitbucket)](https://camo.githubusercontent.com/6a291ac0d18fe5608301e98a8cfe3d458f3bfbc0bd2f7c70369219817edc6cd9/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f5a617a616d612f416e616c79746963733f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/6a291ac0d18fe5608301e98a8cfe3d458f3bfbc0bd2f7c70369219817edc6cd9/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f5a617a616d612f416e616c79746963733f7374796c653d666c61742d737175617265)

Introduction
------------

[](#introduction)

This module enables basic analytics in Silverstripe without saving identifying data.

[![Screenshot](docs/images/screenshot.png)](docs/images/screenshot.png)

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

[](#requirements)

- silverstripe/framework ^5
- silverstripe/admin ^2

For Silverstripe 4, check out version/branch 1.

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

[](#installation)

```
composer require wakeworks/analytics

```

After a /dev/build, the module will start logging requests. You can find an overview of the data at /admin/analytics.

**ATTENTION: Please read through "[Garbage Collection](#garbage-collection)" if you don't want your database to grow infinitely.**

How does it work?
-----------------

[](#how-does-it-work)

- On every request, a user sends its User-Agent string to the server. Using a middleware and matomo/device-detector, we can parse it and check which browser/device it is or if it's a bot.
- This information is stored in the database together with [other collected analytics](#which-information-is-stored).
- On first visit of a user, we write a note into the session to be able to mark it as unique.
- In order to filter out as many bots as possible, we don't save any request with an unknown User-Agent. To optimize bot detection, use [image verification](#improve-bot-detection-by-using-image-verification).
    Also, some routes are automatically skipped, e.g. UserDefinedFormController/ping, /admin/\* or /dev/\*, see "[When is no information stored?](#When-is-no-information-stored)".

Improve bot detection by using image verification
-------------------------------------------------

[](#improve-bot-detection-by-using-image-verification)

While removing unknown User-Agents already takes away a fair share of bots, there are still many crawlers that just call your website without loading its content.

In order to remove them from the statistics, you can insert an image tracking code by activating it with the following configuration.

```
WakeWorks\Analytics\Middlewares\AnalyticsProcessorMiddleware:
  image_verification: true
```

This method works by inserting a hidden `` tag before `` on every valid tracking request. If a user loads the image, the request will create an entry in the database, otherwise it won't.

Garbage Collection
------------------

[](#garbage-collection)

After some time, your database will fill up with too many requests that you might not care about anymore (e.g. very old ones).

Use the task `/dev/tasks/AnalyticsGarbageCollectionTask` in order to delete them.

You should do this automatically, by using a cron job or, if that's not possible, by activating the Garbage Collection every xth request via the middleware.

```
WakeWorks\Analytics\Middlewares\AnalyticsProcessorMiddleware:
  # Run AnalyticsGarbageCollectionTask with probability of 1/100
  # => ~ every 100 requests. (Default: 0, off)
  gc_divisor: 100
  # Delete requests older than (default) 365 days.
  preserve_for_days: 365
```

Only do this if the amount of requests you collect is reasonably small, otherwise the DELETE query might take uncomfortably long for the visitor.

Extension for Subsites
----------------------

[](#extension-for-subsites)

If you have `silverstripe/subsites` installed and want to track by Subsite, you can simply enable the `SubsiteExtension` and everything will work out of the box.

```
WakeWorks\Analytics\Models\AnalyticsLog:
  extensions:
    - WakeWorks\Analytics\Extensions\SubsitesExtension
```

Which information is stored?
----------------------------

[](#which-information-is-stored)

- Current date
- Requested url
- Operating System with version
- Browser with version
- Device type (desktop, smartphone etc.)
- Unique visit
- SiteTreeID (PageID) if possible

When is no information stored?
------------------------------

[](#when-is-no-information-stored)

- Unidentifiable/Bot User-Agents
- Status codes that are not between 200-204 due to bots spamming /wp-\* etc.
- Admin backend urls
- Security urls / Controller
- DevelopmentAdmin Controller (/dev urls)
- UserDefinedFormController/ping

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.7% 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 ~128 days

Recently: every ~247 days

Total

10

Last Release

401d ago

Major Versions

1.x-dev → 2.0.02024-10-07

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7694808?v=4)[Jan Metzger](/maintainers/Zazama)[@Zazama](https://github.com/Zazama)

![](https://www.gravatar.com/avatar/952c91f22ff89bfb25c32822340e47aef16aec424c492e19fc9840c51092b0cc?d=identicon)[wakeworks](/maintainers/wakeworks)

---

Top Contributors

[![Zazama](https://avatars.githubusercontent.com/u/7694808?v=4)](https://github.com/Zazama "Zazama (29 commits)")[![pausenaufsicht](https://avatars.githubusercontent.com/u/102295395?v=4)](https://github.com/pausenaufsicht "pausenaufsicht (1 commits)")

---

Tags

silverstripeanalytics

### Embed Badge

![Health badge](/badges/wakeworks-analytics/health.svg)

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

###  Alternatives

[axllent/silverstripe-analytics-js

Google Universal Analytics tracking code for Silverstripe

1721.3k](/packages/axllent-silverstripe-analytics-js)[wedevelopnl/silverstripe-elemental-grid

Elemental grid module

1014.1k2](/packages/wedevelopnl-silverstripe-elemental-grid)

PHPackages © 2026

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