INSAnalytics Class Reference

Inherits from NSObject
Conforms to INSSDKModule
Declared in INSAnalytics.h

Overview

INSAnalytics class is conform to INSSDKModule protocol and provides an interface to Insiteo analytics backend.

Tracking methods will return immediately and cache the event to be handled “eventually.” That is, the request will be sent according to your configuration if possible or the next time a network connection is available.

Custom Events

+ trackCustomEvent:metadata:debug:error:

Tracks the occurrence of a custom event with additional metadata.

+ (BOOL)trackCustomEvent:(NSString *)name metadata:(NSDictionary<NSString*,NSString*> *)metadata debug:(BOOL)isDebug error:(NSError **)error

Parameters

name

The event name.

metadata

Related event metadata. Keys and values should be NSStrings, will throw otherwise.

isDebug

Boolean used to tag the custom event as debug.

error

Pointer to a NSError that will be set if an error occured.

Return Value

YES is the event creation succeed, NO otherwise.

Discussion

To track a specific event consider the following example:

NSError error; NSDictionary metadata = @{ @“mydata1”: @“data1”, @“mydata2”: @“data2”, @“mydata3”: @“data3” }; [INSAnalytics trackCustomEvent:@“myevent” metadata:metadata debug:NO error:&error];

Declared In

INSAnalytics.h

Debug Mode

+ setDebugMode:

Enables or disables Analytics debug mode.

+ (void)setDebugMode:(BOOL)enable

Parameters

enable

Passing YES will flag EVERY analytics messages as debug on creation (except your custom events).

Declared In

INSAnalytics.h