Mobile SDK iOS: EPZAnalyticsService
From ePrize Developers Wiki
Contents |
Overview
The EPZAnalyticsService class is a Singleton class that provides the necessary logic to queue events to be tracked inside of an app.
Since this class is a Singleton, you will not create an instance of it. Rather, you will simply reference the sharedService property to access the methods to be called from the class.
Tasks
Getting the Shared Service Instance
+ sharedService
Queuing Events
- queueEvent:data:
Class Methods
sharedService
Returns the singleton library instance.
+ (EPZAnalyticsService *) sharedService
Declared In
EPZAnalyticsService.h
Instance Methods
queueEvent:data:
Adds the passed-in event/data into the queue of events to be tracked for the app.
- (void) queueEvent:(NSString *)event data:(NSDictionary *)data
Parameters
- event
- The event name used to track the event.
- data
- A dictionary of additional data to pass along with the event.
Discussion
This method lets you add custom events into the analytics queue used by the SDK. This allows greater flexibility to track user engagement within your app.
Declared In
EPZAnalyticsService.h
Notifications
The EPZAnalyticsService dispatches an NSNotification to the default NSNotificationCenter since there is no set delegate implementation for the service.
Below is the list of NSNotifications dispatched along with applicable data attached to each via the NSNotification userInfo dictionary. Note that each Notification name and data key use a Constant value, as defined in EPZConstants.
EPZ_NOTIFICATION_ANALYTICS_EVENT_TRACKED
Dispatched when an analytics event has successfully been tracked (after having been added to the events queue via the queueEvent:data: method).
- userInfo Keys:
- EPZ_NOTIFICATION_KEY_SENDER - The sender of the notification
- EPZ_NOTIFICATION_KEY_DATA - A dictionary object with all applicable event data key/value pairs.