Matomo.Xamarin.Forms
1.1.0
dotnet add package Matomo.Xamarin.Forms --version 1.1.0
NuGet\Install-Package Matomo.Xamarin.Forms -Version 1.1.0
<PackageReference Include="Matomo.Xamarin.Forms" Version="1.1.0" />
paket add Matomo.Xamarin.Forms --version 1.1.0
#r "nuget: Matomo.Xamarin.Forms, 1.1.0"
// Install Matomo.Xamarin.Forms as a Cake Addin #addin nuget:?package=Matomo.Xamarin.Forms&version=1.1.0 // Install Matomo.Xamarin.Forms as a Cake Tool #tool nuget:?package=Matomo.Xamarin.Forms&version=1.1.0
Matomo.Xamarin.Forms
This library provides Matomo Tracking for Xamarin.Forms Apps.
Status
Initial Setup
Getting started with Matomo.Xamarin.Forms is pretty easy:
Add the Matomo.Xamarin.Forms Nuget to your project
In your App.xaml.cs add:
private static object _matomoSyncRoot = new object();
private static MatomoAnalytics _matomoAnalytics;
public static MatomoAnalytics MatomoAnalytics
{
get
{
lock (_matomoSyncRoot)
if (_matomoAnalytics == null)
{
_matomoAnalytics = new MatomoAnalytics("https://url.to.matomo.instance/", 1);
_matomoAnalytics.AppUrl = "https://app/";
}
return _matomoAnalytics;
}
}
The code above connects your app to site number 1 on your Matomo instance, change the Url and the Site ID accordingly.
In addition this code will Expose the MatomoAnalytics class to your App by just calling App.MatomoAnalytics
.
- In your App.xaml.cs OnSleep Method add:
MatomoAnalytics.LeavingTheApp();
The library will batch submit the tracking data upon the app going into Background, without this call you will not receive any Tracking Data!
- When using Shell navigation tracking page visits is made simple with the
ShellHelper
: Add to your OnAppearing methods the following call:
App.MatomoAnalytics.TrackPage(Shell.Current.Title, ShellHelper.Instance.CurrentPath);
ShellHelper.Instance.CurrentPath
generates you the full path to the Page you are currently starting to watch.
Documentation
You can find a reference documentation here.
And a sample project in the Sample/
folder.
Credit
This work is based on the work done at zauberzeug/xamarin.piwik
License
This project retains the MIT license as per the original project.
Support
In case of issues with the library feel free to provide feedback via the Issues tab or if you want to support the project feel free to contribute via Pull Request.
If you need assistance getting started with Matomo and .NET MAUI feel free to reach out.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Newtonsoft.Json (>= 13.0.2)
- Xamarin.Essentials (>= 1.7.5)
- Xamarin.Forms (>= 5.0.0.2545)
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.0 | 253 | 3/15/2023 |
1.1.0-pre001 | 161 | 3/15/2023 |
1.0.0 | 230 | 2/23/2023 |
1.0.0-pre002 | 129 | 2/23/2023 |