Add the nuget package to your PCL project and the platform specific project(s) (Xamarin.iOS and/or Xamarin.Android).
Platform Support
Platform | Supported | Version |
---|---|---|
Xamarin.iOS Unified | Yes | iOS 8+ |
Xamarin.Android | Yes | API 21+ |
Before you can track an activity, you first need to call the initialise method once with the UA-ID of your Google Analytics project.
Here you can create an UA-ID for your project: https://analytics.google.com
Initialise method:
CrossGoogleAnalytics.Current.Init ("<UA-ID of your project>");
Now you are ready to track a page view or event to the Google Analytics portal
Track page method:
CrossGoogleAnalytics.Current.TrackPage ("<page name>");
Track event method:
CrossGoogleAnalytics.Current.TrackEvent ("<category>", "<action>", "<label>");
Current release: 1.0.0.5
Release notes: initial version
v1.0.0.5 - https://github.com/stefan89