Collecting data about how your users are using your app is very important, without that data, you don't know what you need to fix and improve. The most obvious is to collect data about crashes and errors. The difference between a crash and an error is that a crash will kill the app and an error is handled. However, it is also important to collect data about user behaviors. What pages do the users view the most? Is that button ever clicked? Data about that and similar stuff can help you to improve the app, you know what pages you should focus the most on and if you see that a button never is clicked, you may have to redesign a page to make it easier for the users to find the button.
I have used Microsoft AppCenter for Analytics for many years, but AppCenter is now scheduled for retirement in March 2025, https://learn.microsoft.com/en-us/appcenter/retirement. There are other options, like Raygun, Sentry, and the ones that are mentioned on the retirement info page. But I don't want to sign up for different services, many of them are pretty expensive and the one I have tried did not fulfill my needs either. I also think that AppCenter was not perfect. I think it was missing a few important features. If you have been a long-time Xamarin developer, you may remember Xamarin Insights. I think that that was a better product in many ways compared to AppCenter. But it was abandoned when Microsoft acquired Xamarin and they started the merge of Xamarin Insights and HockeyApp (also a company Microsoft acquired).
I have always liked Azure Application Insights, but that one is more built for the web with HTTP requests in focus. At least if we talk about the graphs and so on that are there to visualize the data. If you track the data yourself and use the Logs feature, where you can write your own queries it is pretty good. But I don't want to write queries every time I want to check my app analytics so I decided to write a web page to visualize the data that is most important for me. I decided to call my new project TinyInsights, because I already had a library that I wrote years ago that was called TinyInsights, it was a wrapper around multiple analytics providers like AppCenter, Google Analytics, and Azure Application Insights. So I decided to revisit that library with an focus on Application Insights and .NET MAUI.
Tiny Insights has two parts, the library and the website.
The Library
The library has the following features.
- Crash handling
- Error handling
- Auto-tracking of page views
- Manual tracking of page views
- Tracking of custom events
The setup is easy, you just add UseTinyInsight in MauiProgram.cs. That will enable auto-tracking of page views and crash handling.
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseTinyInsights("{YOUR_CONNECTION_STRING}")
To manually track data you can just inject the IInsights interface in for example your ViewModel.
private readonly IInsights insights;
public MainViewModel(IInsights insights)
{
this.insights = insights;
}
[RelayCommand]
private async Task Save()
{
await insights.TrackEventAsync("SaveButtonTapped");
}
To learn more about how to set it up and use it, check the docs on GitHub: https://github.com/dhindrik/TinyInsights.Maui
The website
The website is a Blazor site that uses the Application Insights API for querying data. Currently, it will show info about:
- Crashes
- Errors
- Users
- Page views
- Custom events
- User devices
However, there are ongoing work on building more views to show more insights about the app.
The site can be run either as a web assembly site or a server site. To use the web assembly site, you just need to add an app ID and an API key. You can try that site here: [https://mauiinsights.z6.web.core.windows.net/](https://mauiinsights.z6.web.core.windows.net/ "Open Tiny Insights test site). However, API keys will not be supported by the Application Insights API after March 2026 therefore I was building the server options. Without API key authentication, you need to use EntraId for authentication and then you need to save some settings for the website and that will be more secure to do on a server. It is also more secure in that way that you don't have to share an API key with the persons who should have access to the site, they can just sign in with their Microsoft work account.
Contribute
TinyInsights is an open-source project and you are very welcome to contribute. There are already a few great contributions from the community. For new features, please create an issue before starting with it, so we can discuss it before you spend a lot of time developing it.
You will find the source-code here: https://github.com/dhindrik/TinyInsights.Maui
Videos about TinyInsights
I have published a few videos about TinyInsights on YouTube:
AppCenter is retiring! This is how to use Application Insights for your .NET MAUI apps
Updates for TinyInsights, what is new for .NET MAUI developers that want to use Application Insights