Palmalytics is a self-hosted, first-party, server-side web analytics dashboard for ASP.NET Core applications. It can replace standard client-side web analytics tools like Google Analytics and Matomo. It tracks pageviews, sessions, referrals, locations, user agents, and more.
Unlike client-side analytics, server-side analytics offers the following advantages:
- High Performance: Minimal impact on the server side as data is saved asynchronously, and zero impact on the client side.
- User-Friendly: No cookies, no annoying consent popups.
- Accuracy: Not blocked by adblockers and privacy-focused browsers and extensions.
- Data Ownership: You own your data, and it doesn’t leave your server.
The data can be stored in the same database your application already uses (e.g. SQL Server), which means you can also easily query it if you'd like.
-
Add the storage-specific NuGet package from the Package Manager Console:
PM> Install-Package Palmalytics.SqlServer -Pre
-
Register services in your
Startup.cs
and configure the SQL Server storage:public void ConfigureServices(IServiceCollection services) { services.AddPalmalytics(options => { options.UseSqlServer(new SqlServerOptions { ConnectionString = Configuration.GetConnectionString("PalmalyticsConnection"), Schema = "Palmalytics" }); }); // ...other services }
-
Register the middleware:
public void Configure(IApplicationBuilder app) { app.UsePalmalytics(); // ...other middleware }
-
Navigate to
https://<your-app>/palmalytics
to see your dashboard.
By default, the dashboard is only accessible by local requests. In production, you will probably want to change this. Here are some options:
If you want to allow public access to your dashboard, just remove the default authorization rule:
services.AddPalmalytics(options =>
{
options.DashboardOptions.Authorize = null;
// ... other options
}
You can implement your own authorization rule, for example based on ASP.NET user roles:
services.AddPalmalytics(options =>
{
options.DashboardOptions.Authorize = (context) =>
{
return context.User.IsInRole("Admin");
};
// ... other options
}
Currently, Palmalytics requires:
- .NET 6
- SQL Server for storage
Future support is planned for older versions of .NET (including .NET Framework 4.x) as well as other data stores (Postgres, SQLite…).
The project is currently in alpha release – use at your own risk.
- Added UTM parameters stats to dashboard
- Added 'not set' values in referrer stats
- Initial version
Copyright © 2024 Xavier Poinas
Palmalytics is licensed under the GNU General Public License (GPL v3), which means that if you include it in your project, you will need to release its source code to comply with the terms of the license. If you don’t want to do that, you can obtain a commercial license.
While Palmalytics is in pre-release, you can get a free early-bird lifetime commercial license by emailing [email protected]. This includes free upgrades to all future versions, including major versions.
Contributions are welcome, whether they are bug reports, feature requests, or code contributions.
By submitting a pull request, you relinquish any rights or claims to the changes you submit to the project and transfer the copyright of those changes to the project owner.