Events are a useful way to collect data about a user's interaction with interactive components of your app, like button presses or the use of a particular item in a game.
An event consists of four fields that you can use to describe a user's interaction with your app content:
- String Category
- String Action
- String Label
- Long (Optional) Value
To send an event to Google Analytics, call SendEvent(). For example, to measure a button press, you might add this code to a button's Click event handler:
Note: The Google Analytics SDK for Windows 8 and Windows Phone may throttle events, as well as other hits, if a large number of send calls are made in a short period of time.
private void ButtonEvent_Click(object sender, RoutedEventArgs e)
Tracker myTracker = EasyTracker.GetTracker();
// Where myTracker is an instance of Tracker.
myTracker.SendEvent("ui_action", "button_press", "play_button", opt_value);
... // Your other click handling code.