Discovering open source WPF components – Orc.Analytics

In the discovering open source WPF components series, I will look into useful open source components that can be used to create WPF apps. This weeks component is Orc.Analytics.

Analytics can be very helpful to analyze what features are being used the most. This information can be used when prioritizing new features or bug reports. Adding analytics to a WPF application can be cumbersome, but thanks to Orc.Analytics this is very easy to accomplish in a few steps:

  1. Create a Google Analytics ID
  2. Customize the service using this code:

Automatically sending data

Thanks to the auditing functionality in Catel, the library will automatically send data when one of the following events occur:

  • Command executed
  • ViewModel created
  • ViewModel closed (because it stores the timings / view model, it will also submit the lifetime of a view model so you can analyze how long a user is on a specific view)

Manually sending data

The library also allows you to manually send data for the following possible analytics events:

  • View (SendViewAsync method)
  • Event (SendEventAsync method)
  • Transaction (SendTransactionAsync method)
  • Timing (SendTimingAsync method)

Manually tracking views

Maybe not all the views have a view model. It is still possible to track these views by using the TrackViewForAnalyticsAsync extension method:

Viewing and analyzing the data

Once all the users are submitting the data (ask them for permission first!), then you can start analyzing your data using Google Analytics:

image