Run the following command in the Package Manager Console
See the analytics.xml parameters reference for the complete list of parameters you can use to configure your implementation.
Add a single line of code to your app for each event you want to track. Here are examples of the different types of activities you can track in your app:
// track a page view
GoogleAnalytics.EasyTracker.GetTracker().SendView("main");
// track a custom event
GoogleAnalytics.EasyTracker.GetTracker().SendEvent("test", "userclick", null, 0);
// manually track an exception
GoogleAnalytics.EasyTracker.GetTracker().SendException("oops, something went wrong", false);
// track a transaction (in app purchase)
double cost = 1.99;
long costInMicrons = (long)(cost * 1000000);
var transaction = new GoogleAnalytics.Transaction("01234", costInMicrons);
var item = new GoogleAnalytics.TransactionItem("myproduct", "My Product", costInMicrons, 1);
transaction.Items.Add(item);
GoogleAnalytics.EasyTracker.GetTracker().SendTransaction(transaction);
// track a social networking interaction
GoogleAnalytics.EasyTracker.GetTracker().SendSocial("facebook", "share", "http://googleanalyticssdk.codeplex.com");
// track a timing (how long it takes your app to run a specific task)
GoogleAnalytics.EasyTracker.GetTracker().SendTiming(DateTime.Now.Subtract(startTime), "Startup", "MainPage", "Label");
detail info: http://googleanalyticssdk.codeplex.com/wikipage?title=Getting%20Started&referringTitle=Documentation
PM> Install-Package GoogleAnalyticsSDK -Pre
By default, a file called analytics.xml will be automatically added to the root of your project. This file contains configuration options that you must edit. At the very least, you should always modify your tracking ID, app name and version:
<?xml version="1.0" encoding="utf-8" ?>
<analytics xmlns="http://googleanalyticssdk.codeplex.com/ns/easytracker">
<!--Replace placeholder ID with your tracking ID-->
<trackingId>UA-XXXX-Y</trackingId>
<!--Replace placeholder name with your app name-->
<appName>TestApp</appName>
<!--Replace placeholder version with your app version-->
<appVersion>1.0.0.0</appVersion>
</analytics>
See the analytics.xml parameters reference for the complete list of parameters you can use to configure your implementation.
Add a single line of code to your app for each event you want to track. Here are examples of the different types of activities you can track in your app:
// track a page view
GoogleAnalytics.EasyTracker.GetTracker().SendView("main");
// track a custom event
GoogleAnalytics.EasyTracker.GetTracker().SendEvent("test", "userclick", null, 0);
// manually track an exception
GoogleAnalytics.EasyTracker.GetTracker().SendException("oops, something went wrong", false);
// track a transaction (in app purchase)
double cost = 1.99;
long costInMicrons = (long)(cost * 1000000);
var transaction = new GoogleAnalytics.Transaction("01234", costInMicrons);
var item = new GoogleAnalytics.TransactionItem("myproduct", "My Product", costInMicrons, 1);
transaction.Items.Add(item);
GoogleAnalytics.EasyTracker.GetTracker().SendTransaction(transaction);
// track a social networking interaction
GoogleAnalytics.EasyTracker.GetTracker().SendSocial("facebook", "share", "http://googleanalyticssdk.codeplex.com");
// track a timing (how long it takes your app to run a specific task)
GoogleAnalytics.EasyTracker.GetTracker().SendTiming(DateTime.Now.Subtract(startTime), "Startup", "MainPage", "Label");
detail info: http://googleanalyticssdk.codeplex.com/wikipage?title=Getting%20Started&referringTitle=Documentation