Sitepoint.Matomo.Core 1.0.10

There is a newer version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sitepoint.Matomo.Core" Version="1.0.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sitepoint.Matomo.Core" Version="1.0.10" />
                    
Directory.Packages.props
<PackageReference Include="Sitepoint.Matomo.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Sitepoint.Matomo.Core --version 1.0.10
                    
#r "nuget: Sitepoint.Matomo.Core, 1.0.10"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Sitepoint.Matomo.Core@1.0.10
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Sitepoint.Matomo.Core&version=1.0.10
                    
Install as a Cake Addin
#tool nuget:?package=Sitepoint.Matomo.Core&version=1.0.10
                    
Install as a Cake Tool

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 Matomo composition (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-User
  • Claude-User
  • Perplexity-User
  • MistralAI-User
  • Gemini-Deep-Research
  • GoogleAgent
  • NovaAct

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.cshtml reads the config from the site root and emits the Matomo _paq snippet.
  • Server-side: AddAiTracking() registers an Umbraco pipeline middleware → detected AI requests are enqueued → a BackgroundService drains the queue → an HttpClient (5s timeout) issues the tracking call to matomo.php. All failures are logged, never thrown.

License

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.1 193 7/29/2026
1.1.0 131 7/29/2026
1.0.10 136 7/24/2026
1.0.9 136 7/23/2026