5

I wanted to have analytics for my upcoming alpha release so I can analyse how the program gets used, how often errors occur and so on.

Implementing an own approach of such is quite difficult and time consuming. Today I saw that the developers of the game "Rust" have implemented Google Analytics to track session times, average framerates based on system architecture and so on. So obviously desktop applications can use GA for that.

Now I did some research and I haven't found out anything. I have the C# assembly for Analytics V3 but I don't get how I can use it to report any data. I created a Developers Console project and added the Analytics API to the project.

But now? Analytics has only Website or Mobile App properties, authentication has only website, server or mobile apps but nowhere is something mentioned about desktop apps.

I've seldom seen such well undocumented features. Not even google spits out helpful information about the usage. All tutorials I can find are about ASP.Net websites and hence not helpful.

Does anybody know how this works? Is there any support planned on the part of Google? Is it even allowed (I guess so if Rust's developers use it)?

Thanks for any help!

SharpShade
  • 1,761
  • 2
  • 32
  • 45
  • 3
    You can use C# to post a request to the GA measurement protocol: https://developers.google.com/analytics/devguides/collection/protocol/v1/ Set up you GA view as web tracking. – osowskit Sep 24 '14 at 23:53

2 Answers2

2

You can use a packaged lib available on NuGet which does most of the heavy lifting of sending data to google analytics. The lib uses performance protocol as mentioned by @osowskit.

Here is the link to one of them. Its open sourced so you can modify the code to your needs.

https://www.nuget.org/packages/GoogleAnalyticsTracker/ Source - https://github.com/maartenba/GoogleAnalyticsTracker

Viral
  • 21
  • 3
  • From the above github link - "This library will not work when the Google Analytics account is configured as an app.". I guess this is not the library you are looking for! – Simon Featherstone Mar 09 '17 at 22:14
  • SoftMeter is another client lib for G.A. (native dll, packaged for NuGet). https://www.nuget.org/packages/libSoftMeter/ Disclaimer: I am its author. – Mike Oct 24 '18 at 09:42
1

Rust game is based on Unity and Google has created Google Analytics Plugin for Unity that "...allows game developers to easily implement Google Analytics in their Unity games on all platforms, without having to write separate implementations.". That is probably what Rust developers are using.

The closest support for non-Unity desktop applications you can get from Google is Analytics Measurement Protocol which allows you "to send raw user interaction data directly to Google Analytics servers". That data could be visited screens/views, events, exceptions etc...For the comprehensive protocol description see Developer Guide.

Bojan Komazec
  • 9,216
  • 2
  • 41
  • 51
  • Thanks for the info! I guess I can go with that. Shouldn't be too difficult to implement some simple usage statistics with that... Don't need that much information anyway. – SharpShade Mar 14 '16 at 14:08