Lately I’ve been looking into NuGet packages and libraries on GitHub to add Google Analytics tracking in .NET WPF applications. There are quite some that offer ways to do this, see the links at the end. They all however have their limitations; either they lack support for WPF (and it’s hard to add) or they use older versions of the Google Measurements Protocol. It’s a shame that Google hasn’t released a tracking library itself! Their Analytics Reporting API is quite good!
So I’ve decided to create my own solution, Allium. As of right now, it is still WIP and untested.
Here is however an extremely simple usage example, which will not change much during development;
using (var session = new AnalyticsSession("UA-XXXXX-YY"))
{
session.TrackScreenViewHit("ThisWindow");
}
Inspired by;