Sitepoint.Matomo.Core
1.0.10
See the version list below for details.
dotnet add package Sitepoint.Matomo.Core --version 1.0.10
NuGet\Install-Package Sitepoint.Matomo.Core -Version 1.0.10
<PackageReference Include="Sitepoint.Matomo.Core" Version="1.0.10" />
<PackageVersion Include="Sitepoint.Matomo.Core" Version="1.0.10" />
<PackageReference Include="Sitepoint.Matomo.Core" />
paket add Sitepoint.Matomo.Core --version 1.0.10
#r "nuget: Sitepoint.Matomo.Core, 1.0.10"
#:package Sitepoint.Matomo.Core@1.0.10
#addin nuget:?package=Sitepoint.Matomo.Core&version=1.0.10
#tool nuget:?package=Sitepoint.Matomo.Core&version=1.0.10
Sitepoint.Matomo.Core
Privacy-friendly Matomo analytics for Umbraco 13 — with a twist: it tracks AI crawlers (ChatGPT, Claude, Perplexity, and friends) that classic JavaScript tracking never sees.
Features
- 🧩 Zero-config content model — a
Matomocomposition (document type + data types) is installed automatically on first boot. - 📈 Client-side tracking — drops the standard Matomo tracking snippet into your pages via a single partial view.
- 🤖 Server-side AI-agent tracking — LLM crawlers run no JavaScript, so they're invisible to normal analytics. This package detects them by User-Agent and records the visit in Matomo server-side.
- ⚙️ Per-site configuration — Site ID, Matomo URL, cookie and Do-Not-Track behaviour are edited by content editors in the backoffice, per content root.
- 🚦 Non-blocking — AI hits are queued on a bounded background channel, so tracking never slows a response or throws into the request pipeline.
Requirements
- Umbraco 13 (
net8.0) - A reachable Matomo instance
Installation
dotnet add package Sitepoint.Matomo.Core
On the next application start, a package migration automatically imports the Matomo composition, its data types, and the tracking partial view. No manual schema setup is required.
Quick start
1. Apply the Matomo composition
In the backoffice, open the document type at the root of your site (e.g. Home) and add the Matomo composition to it. A new Matomo → Configuration tab appears with these fields:
| Field | Alias | Purpose |
|---|---|---|
| Status | status |
Master switch for the client-side snippet. |
| SiteId | siteId |
The numeric website ID from Matomo (Administration → Websites → Manage). |
| MatomoUrl | matomoUrl |
Base URL of your Matomo install, e.g. https://analytics.example.com (no trailing slash, no /matomo.php). |
| Disable Cookies | disableCookies |
Emits disableCookies — runs Matomo cookieless. |
| Do Not Track | doNotTrack |
Emits setDoNotTrack — honours the browser DNT signal. |
Fill in SiteId and MatomoUrl, and turn Status on.
2. Add the tracking snippet to your layout
Render the partial once in your master layout, ideally in <head>:
@await Html.PartialAsync("matomo/tagManager")
The snippet only renders when Status is on and the configuration is valid, so it's safe to leave in place across environments.
3. Enable AI-agent tracking (optional)
To also record AI crawlers server-side, call AddAiTracking() when building Umbraco in Program.cs:
using Sitepoint.Matomo.Core.Extensions;
builder.CreateUmbracoBuilder()
.AddBackOffice()
.AddWebsite()
.AddDeliveryApi()
.AddComposers()
.AddAiTracking() // 👈 registers the AI-tracking middleware
.Build();
That's it — the background worker and HTTP client are registered automatically by the package's composer.
AI-agent tracking
When a front-end request arrives with a known AI-crawler User-Agent, the middleware finds the nearest content node carrying the Matomo composition and sends a server-side hit to Matomo's tracking endpoint. Backoffice and /api requests are ignored.
Detected agents (matched case-insensitively as substrings):
ChatGPT-UserClaude-UserPerplexity-UserMistralAI-UserGemini-Deep-ResearchGoogleAgentNovaAct
Hits are placed on a bounded in-memory queue (capacity 1000, oldest dropped under pressure) and flushed by a hosted background service, so request latency is never affected.
Configuration
Server-side settings are read from the Matomo section of your app configuration:
{
"Matomo": {
"Token": "your_matomo_auth_token"
}
}
| Key | Description |
|---|---|
Matomo:Token |
Matomo token_auth used for authenticated server-side tracking. Store it in user secrets or environment variables rather than committing it. |
Per-site values (Site ID, Matomo URL, cookie / DNT behaviour) live on the content node, not in appsettings.json, so different sites in a multi-site install can each point at their own Matomo configuration.
How it works
- Client-side:
matomo/tagManager.cshtmlreads the config from the site root and emits the Matomo_paqsnippet. - Server-side:
AddAiTracking()registers an Umbraco pipeline middleware → detected AI requests are enqueued → aBackgroundServicedrains the queue → anHttpClient(5s timeout) issues the tracking call tomatomo.php. All failures are logged, never thrown.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Umbraco.Cms.Web.BackOffice (>= 13.0.0 && < 14.0.0)
- Umbraco.Cms.Web.Website (>= 13.0.0 && < 14.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.