Search by

letterncms / analytics

FalkoJoseph

Site analytics on your own server: page views per day by default, with visitors, sources and devices as an option.

Package info

github.com/letterncms/analytics

Type:cms-plugin

pkg:composer/letterncms/analytics

Statistics

Installs: 32

Dependents: 0

Suggesters: 0

Stars: 0

0.9.0 2026-11-12 05:42 UTC

This package is auto-updated.

Last update: 2026-11-12 05:42:39 UTC


README

Site analytics on your own server: page views per day by default, with visitors, sources and devices as an option. In the default mode a published page carries one image and nothing is read from the browser; visitors mode adds a small script that skips people who opt out (Do Not Track, Global Privacy Control) and, unless you turn that off, waits for consent: window.cmsConsent.analytics === true or a cms:consent event.

Install

From Plugins → Store in the admin, or:

composer require letterncms/analytics

Settings

On the Settings tab of Analytics, kept in config/analytics.yaml:

  • Count Visits (enabled): counts views on the published site. On by default.
  • What to Count (mode): counts, page views only, or visitors, with visitors, sources and devices. Switching back to page views deletes visitor data.
  • Wait for Consent (consent_required): in visitors mode, count only once the visitor agreed. On by default.
  • Paths Not to Count (exclude): paths or patterns such as /drafts/*.
  • Keep Visits For (retention_days): days to keep visits; 0 keeps them forever. 730 by default.
  • Reporting Address (endpoint): the CMS's address, when the built site is hosted elsewhere.

Abilities

  • analytics/summary: page views for the last 7, 30 or 90 days, the period before to compare, and a row per day; in visitors mode also visitors, views per visit, bounce rate and who is on the site now. Needs analytics.view.
  • analytics/breakdown: views per page or language; in visitors mode also per entry page, source, device, browser or operating system. Needs analytics.view.

Each says what it answers with (output). The permission analytics.view (View Site Analytics) comes with the Editor role.

Hooks

  • analytics.known-path (filter): fn (bool $known, string $path): bool. Return true for an address your plugin answers itself, so views of it are counted; pages of the site are known already.
  • Uses the core's site.policy filter: a Reporting Address on another host is named in the public pages' content security policy (connect-src, img-src).

This repository is published from letterncms/plugins-public. Open issues and pull requests there.