PWAnalytics Class Reference

Inherits from NSObject
Declared in PWAnalytics.h

Overview

PWAnalytics enables easy implementation of application workflow analytics. MaaSAnalytics supports standard analytics events, timed events and event parameters.

Event Methods

+ addCustomEvent:

Add an event to the analytics queue.

+ (void)addCustomEvent:(NSString *__nonnull)eventName

Parameters

eventName

Name of the event.

Declared In

PWAnalytics.h

+ addCustomEvent:withParameters:

Add an event to the analytics queue. Parameters must follow these rules: (1) Keys and values must be NSString objects. (2) There may be no more than 5 parameters. Extra parameters will be ignored. (3) Each key or value that is longer than 40 characters will be truncated on server.

+ (void)addCustomEvent:(NSString *__nonnull)eventName withParameters:(NSDictionary<NSString*,NSString*> *__nullable)parameters

Parameters

eventName

Name of the event.

parameters

NSString key / value parameters. For example, @{@"key" : @"value"}.

Declared In

PWAnalytics.h

+ setScreenName:

Set a screen name for automatic screen view events. This should be set in the viewWillAppear callback of your view controller before calling super viewWillAppear.

+ (void)setScreenName:(NSString *__nonnull)screenName

Parameters

screenName

Screen name for the view event.

Declared In

PWAnalytics.h

+ setAppSection:

Set an app section for automatic screen view events. This should be set in the viewWillAppear callback of your view controller before calling super viewWillAppear.

+ (void)setAppSection:(NSString *__nullable)appSection

Parameters

appSection

App section for the view event.

Declared In

PWAnalytics.h

+ setGlobalParameters:

Set global parameters for all events. This should be set in the viewWillAppear callback of your view controller before calling super viewWillAppear.

+ (void)setGlobalParameters:(NSDictionary<NSString*,NSString*> *__nullable)parameters

Parameters

parameters

Parameters included for all events until cleared.

Declared In

PWAnalytics.h

+ enableAutomaticScreenViewEvents:

Determines whether automatic screen views are captured.

+ (void)enableAutomaticScreenViewEvents:(BOOL)enable

Parameters

enable

Will automatically capture screen view events or not. Defaults to enabled.

Declared In

PWAnalytics.h

+ addEvent:

Add an event to the analytics queue.

+ (void)addEvent:(NSString *__nonnull)eventName

Parameters

eventName

Name of the event.

Declared In

PWAnalytics.h

+ addEvent:eventNamespace:

Add an event to the analytics queue.

+ (void)addEvent:(NSString *__nonnull)eventName eventNamespace:(NSString *__nonnull)eventNamespace

Parameters

eventName

Name of the event.

eventNamespace

The namespace of the analytic event. Used for custom event processing.

Declared In

PWAnalytics.h

+ addEvent:withParameters:

Add an event to the analytics queue. Parameters must follow these rules: (1) Keys and values must be NSString objects. (2) There may be no more than 10 parameters. Extra parameters will be ignored. (3) Each key or value that is longer than 256 characters will be truncated.

+ (void)addEvent:(NSString *__nonnull)eventName withParameters:(NSDictionary<NSString*,NSString*> *__nullable)parameters

Parameters

eventName

Name of the event.

parameters

NSString key / value parameters. For example, @{@"key" : @"value"}.

Declared In

PWAnalytics.h

+ addEvent:withParameters:eventNamespace:

Add an event to the analytics queue. Parameters must follow these rules: (1) Keys and values must be NSString objects. (2) There may be no more than 10 parameters. Extra parameters will be ignored. (3) Each key or value that is longer than 256 characters will be truncated.

+ (void)addEvent:(NSString *__nonnull)eventName withParameters:(NSDictionary<NSString*,NSString*> *__nullable)parameters eventNamespace:(NSString *__nullable)eventNamespace

Parameters

eventName

Name of the event.

parameters

NSString key / value parameters. For example, @{@"key" : @"value"}.

eventNamespace

The namespace of the analytic event. Used for custom event processing.

Declared In

PWAnalytics.h

+ startTimedEvent:

Start a timed event. Calling startTimedEvent: with the same eventName prior to endTimedEvent: will overwrite the previous start time.

+ (void)startTimedEvent:(NSString *__nonnull)eventName

Parameters

eventName

Name of the event to start.

Declared In

PWAnalytics.h

+ startTimedEvent:eventNamespace:

Start a timed event. Calling startTimedEvent: with the same eventName prior to endTimedEvent: will overwrite the previous start time.

+ (void)startTimedEvent:(NSString *__nonnull)eventName eventNamespace:(NSString *__nullable)eventNamespace

Parameters

eventName

Name of the event to start.

eventNamespace

The namespace of the analytic event. Used for custom event processing.

Declared In

PWAnalytics.h

+ startTimedEvent:withParameters:

Start a timed event with the specified parameters. Calling startTimedEvent: with the same eventName prior to endTimedEvent: will overwrite the previous start time. Parameters must follow these rules: (1) Keys and values must be NSString objects. (2) There may be no more than 10 parameters. Extra parameters will be ignored. (3) Each key or value that is longer than 256 characters will be truncated.

+ (void)startTimedEvent:(NSString *__nonnull)eventName withParameters:(NSDictionary<NSString*,NSString*> *__nullable)parameters

Parameters

eventName

Name of the event to start.

parameters

NSString key / value parameters. For example, @{@"key" : @"value"}.

Declared In

PWAnalytics.h

+ startTimedEvent:withParameters:eventNamespace:

Start a timed event with the specified parameters. Calling startTimedEvent: with the same eventName prior to endTimedEvent: will overwrite the previous start time. Parameters must follow these rules: (1) Keys and values must be NSString objects. (2) There may be no more than 10 parameters. Extra parameters will be ignored. (3) Each key or value that is longer than 256 characters will be truncated.

+ (void)startTimedEvent:(NSString *__nonnull)eventName withParameters:(NSDictionary<NSString*,NSString*> *__nullable)parameters eventNamespace:(NSString *__nullable)eventNamespace

Parameters

eventName

Name of the event to start.

parameters

NSString key / value parameters. For example, @{@"key" : @"value"}.

eventNamespace

The namespace of the analytic event. Used for custom event processing.

Declared In

PWAnalytics.h

+ pauseTimedEvent:

Pause a timed event with the specified eventName. If an event is ended while still in a paused state, then the paused time will be used as the end time. If an event is already paused, this method will do nothing.

+ (void)pauseTimedEvent:(NSString *__nonnull)eventName

Parameters

eventName

The name of the event to pause.

Declared In

PWAnalytics.h

+ resumeTimedEvent:

Resume a timed event with the specified eventName. If an event is ended while still in a paused state, then the paused time will be used as the end time. If an event is already paused, this method will do nothing.

+ (void)resumeTimedEvent:(NSString *__nonnull)eventName

Parameters

eventName

The name of the event to resume.

Declared In

PWAnalytics.h

+ endTimedEvent:

End a timed event with the specified eventName. The event will be ignored if the event duration is less than one second. This method will do nothing if the event name cannot be found.

+ (void)endTimedEvent:(NSString *__nonnull)eventName

Parameters

eventName

The name of the event to end.

Declared In

PWAnalytics.h

+ endTimedEvent:withParameters:

End a timed event with the specified eventName. The event will be ignored if the event duration is less than one second. This method will do nothing if the event name cannot be found. Parameters must follow these rules: (1) Keys and values must be NSString objects. (2) There may be no more than 10 parameters. Extra parameters will be ignored. (3) Each key or value that is longer than 256 characters will be truncated.

+ (void)endTimedEvent:(NSString *__nonnull)eventName withParameters:(NSDictionary<NSString*,NSString*> *__nullable)parameters

Parameters

eventName

The name of the event to end.

parameters

NSString key / value parameters. For example, @{@"key" : @"value"}.

Declared In

PWAnalytics.h

+ endTimedEvent:withParameters:eventNamespace:

End a timed event with the specified eventName. The event will be ignored if the event duration is less than one second. This method will do nothing if the event name cannot be found. Parameters must follow these rules: (1) Keys and values must be NSString objects. (2) There may be no more than 10 parameters. Extra parameters will be ignored. (3) Each key or value that is longer than 256 characters will be truncated.

+ (void)endTimedEvent:(NSString *__nonnull)eventName withParameters:(NSDictionary<NSString*,NSString*> *__nullable)parameters eventNamespace:(NSString *__nullable)eventNamespace

Parameters

eventName

The name of the event to end.

parameters

NSString key / value parameters. For example, @{@"key" : @"value"}.

eventNamespace

The namespace of the analytic event. Used for custom event processing.

Declared In

PWAnalytics.h