Telemetry plays an important role for developers who need insights into how users are using their applications. The data can include regular user engagement information, or something far more critical like application crash statistics.
Google Analytics is a tool that lets developers do this with comparative ease. However, Google doesn’t like Windows very much. Thus, Microsoft takes the mantle and gives developers what they want.
Microsoft today released a Windows SDK for Google Analytics. Windows 10 app developers – on mobile or PC – can utilize the SDK in their applications.
Despite the difference, all variants use the same API names, so developers can port most of the code between them without much work.
In addition to that, the API names and the design patterns have been crafted to be similar to Google’s Android SDK, making porting any existing code from Android even easier.
It’s not hard to get started with the new SDK, thanks to the NuGet package manager in Visual Studio. Here’s how you do it:
- Register your app for Google Analytics. Make sure to register it as a mobile app and not as a website.
Add the appropriate variant of the new SDK to your project via NuGet.
- Finally, add the code to track events across the app.
Finally, Microsoft has also made the SDK open-source. The project is on GitHub, and developers are free to contribute to it with their improvements and expertise.
If you discover any bugs or have any feedback, GitHub is also where you submit them.