This developer guide describes how to measure events in your app using the Google Analytics SDK for iOS v3.
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:
|Field Name||Tracker Field||Type||Required||Description|
||Yes||The event category|
||Yes||The event action|
||No||The event label|
||No||The event value|
To send an event to Google Analytics, use
and send the hit, as in this example:
// May return nil if a tracker has not already been initialized with a property // ID. id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker]; [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"ui_action" action:@"button_press" label:@"play" value:nil] build]];