4

I want to track usage for my Cross Platform Apps developed with the Xamarin Tools (MonoTouch, MonoDroid, Windows Phone) with Google Analytics. While there is a MonoTouch binding around, it seems I need to create the MonoDroid binding myself (see this hint). I've not jet investigated WP.

Because some of my tracking takes place in the shared code between platforms --- and for general ease of use, I am looking for a common library to be utilized in all three projects. Is there something like this around? If not, is there some hidden problematic why such a library can not easily be created?

Jannie Theunissen
  • 28,256
  • 21
  • 100
  • 127
Rodja
  • 7,998
  • 8
  • 48
  • 55

3 Answers3

1

I know this is an older thread, but I thought that I would add that there is now a component for Google Analytics: http://components.xamarin.com/view/googleanalytics.

valdetero
  • 4,624
  • 1
  • 31
  • 46
0

You should be able to make the Google Analytics requests yourself, using Google's API in C#.

This would work on all three platforms, but I have not found an open source project for this. There are several code examples, online however, here is a link.

jonathanpeppers
  • 26,115
  • 21
  • 99
  • 182
  • Your link talks about GA API, not the tracking code. But your answer made me search for native C# implementations instead of binding the platform specific tracking libs provided by Google. – Rodja Aug 24 '12 at 05:07
0

I found a native C# implementation which generates the tracking requests by itself instead of wrapping the platform specific tracking libraries from Google into a common API: https://github.com/maartenba/GoogleAnalyticsTracker

Unfortunately the code does not accumulate tracking requests to dispatch them in intervals, but for my purposes it's sufficient.

There is also another implementation where tracking methods and request dispatching are separated (but not carried out automatically): http://www.diaryofaninja.com/projects/details/ga-dot-net

Rodja
  • 7,998
  • 8
  • 48
  • 55