Pericia.AspNetCore.Matomo 1.0.0

dotnet add package Pericia.AspNetCore.Matomo --version 1.0.0                
NuGet\Install-Package Pericia.AspNetCore.Matomo -Version 1.0.0                
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="Pericia.AspNetCore.Matomo" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pericia.AspNetCore.Matomo --version 1.0.0                
#r "nuget: Pericia.AspNetCore.Matomo, 1.0.0"                
#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.
// Install Pericia.AspNetCore.Matomo as a Cake Addin
#addin nuget:?package=Pericia.AspNetCore.Matomo&version=1.0.0

// Install Pericia.AspNetCore.Matomo as a Cake Tool
#tool nuget:?package=Pericia.AspNetCore.Matomo&version=1.0.0                

Pericia.AspNetCore.Matomo

Build status

ASP.NET Core Tag helper for Matomo analytics service

Install

The library Pericia.AspNetCore.Matomo is available on Nuget : NuGet

You can install it with the following command line in your Package Manager Console :

Install-Package Pericia.AspNetCore.Matomo

Or with dotnet core :

 dotnet add package Pericia.AspNetCore.Matomo 
 	 

GDPR compliance

This library is built to help you to be compliant with the European General Data Protection Regulation (GDPR), and is based on the CNIL recommendations

In order to be fully compliant, you need to configure Matomo to anonymize data, and mask at leat 2 bytes of the visitors' IP. You also have to let the user opt-out, by addind the opt-out iframe in your privacy page (see below).

If you don't do this, you must ask for user consent before to add the tracking tag.

How to use

Configuration

Add a "Matomo" section in your settings file :

"Matomo": {
	"TrackerUrl": "https://stats.example.com",
	"SiteId": "1",
	"TrackerOptions": {
		"DisableCookieTimeoutExtension": true,
		"NoScriptTracking": true,
		"PrependDomainToTitle": false,
		"ClientDoNotTrackDetection": true
	},
	"OptoutOptions": {
		"Language": "fr"
	}
}

Required parameters :

  • TrackerUrl : the url of your matomo site
  • SiteId : the id of the website in matomo

Optional parameters :

  • TrackerOptions:DisableCookieTimeoutExtension : limit the cookie duration to 13 months - required for GDPR compliance (defaults true)
  • TrackerOptions:NoScriptTracking : tracks users with JavaScript disabled (defaults true)
  • TrackerOptions:PrependDomainToTitle : prepend the site domain to the page title when tracking (defaults false)
  • TrackerOptions:ClientDoNotTrackDetection : enable client side DoNotTrack detection (defaults true)
  • OptoutOptions:Language : the 2-letter code for the language used in the opt-out screen (defaults en)

Tag helpers

Reference the tag helpers :

@addTagHelper *, Pericia.AspNetCore.Matomo

Add the tracking script in your page before </head>

<matomo-tracking></matomo-tracking>

Add the opt-out iframe in your Privacy page

<matomo-opt-out></matomo-opt-out>
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.0.0 1,090 2/11/2022
0.0.4 535 11/30/2019
0.0.3 557 6/14/2019
0.0.2 497 6/13/2019
0.0.1 528 6/13/2019