Inherits from NSObject
Declared in KiiVariation.h

Overview

Class that encapsulate variation of an experiment in AB Testing.

Properties

name

Get the name of variation.

@property (nonatomic, readonly) NSString *name

Discussion

Get the name of variation.

Declared In

KiiVariation.h

percentage

Get the percentage of variation to be applied.

@property (nonatomic, readonly) int percentage

Discussion

Get the percentage of variation to be applied.

Declared In

KiiVariation.h

variableDictionary

Get the test of variation defined by you on the developer portal.

@property (nonatomic, readonly, nullable) NSDictionary *variableDictionary

Discussion

Get the test of variation defined by you on the developer portal.

Declared In

KiiVariation.h

Instance Methods

eventDictionaryForConversion:

Generate event dictionary for conversion by given KiiConversionEvent instance.

- (nonnull NSDictionary *)eventDictionaryForConversion:(KiiConversionEvent *)conversionEvent

Parameters

conversionEvent

an instance of KiiConversionEvent.

Return Value

a dictionary consist of events.

Discussion

Generate event dictionary for conversion by given KiiConversionEvent instance.

You will generate event when the specified condition in the KiiExperiment has achieved.

ex.) User has signed up, view the message, purchase item, etc.

You need to call <KiiAnalytics#trackEvent:withExtras:> and pass experiment ID and returned dictionary to send the event to Kii Analytics cloud.

 NSError* error = nil;
 KiiExperiment* experiment = [KiiExperiment getExperimentSynchronous:@"MyExperiment" withError:&error];
 if (error != nil) {
     // check error and return.
     return;
 }
 KiiVariation* variation = [experiment appliedVariationWithError:&error];
 if (error != nil) {
     // check error and return.
     return;
 }
 KiiConversionEvent* c1 = [experiment conversionEventAtIndex:0];
 NSDictionary* dict = [variation eventDictionaryForConversion:c1];

 [KiiAnalytics trackEvent:[experiment experimentID] withExtras:dict];

Declared In

KiiVariation.h

eventDictionaryForConversionAtIndex:

Generate event dictionary for conversion by given index.

- (nullable NSDictionary *)eventDictionaryForConversionAtIndex:(int)index

Parameters

index

conversion event index.

Return Value

a dictionary consist of events. Returns nil if index is out of range.

Discussion

Generate event dictionary for conversion by given index.

You will generate event when the specified condition in the KiiExperiment has achieved.

ex.) User has signed up, view the message, purchase item, etc.

You need to call <KiiAnalytics#trackEvent:withExtras:> and pass experiment ID and returned dictionary to send the event to Kii Analytics cloud.

 NSError* error = nil;
 KiiExperiment* experiment = [KiiExperiment getExperimentSynchronous:@"MyExperiment" withError:&error];
 if (error != nil) {
     // check error and return.
     return;
 }
 KiiVariation* variation = [experiment appliedVariationWithError:&error];
 if (error != nil) {
     // check error and return.
     return;
 }
 NSDictionary* dict = [variation eventDictionaryForConversionAtIndex:0];

 [KiiAnalytics trackEvent:[experiment experimentID] withExtras:dict];

Declared In

KiiVariation.h

eventDictionaryForConversionWithName:

Generate event dictionary for conversion by given index.

- (nullable NSDictionary *)eventDictionaryForConversionWithName:(NSString *)name

Parameters

name

conversion event name.

Return Value

a dictionary consist of events. Returns nil if not found.

Discussion

Generate event dictionary for conversion by given index.

You will generate event when the specified condition in the KiiExperiment has achieved.

ex.) User has signed up, view the message, purchase item, etc.

You need to call <KiiAnalytics#trackEvent:withExtras:> and pass experiment ID and returned dictionary to send the event to Kii Analytics cloud.

 NSError* error = nil;
 KiiExperiment* experiment = [KiiExperiment getExperimentSynchronous:@"MyExperiment" withError:&error];
 if (error != nil) {
     // check error and return.
     return;
 }
 KiiVariation* variation = [experiment appliedVariationWithError:&error];
 if (error != nil) {
     // check error and return.
     return;
 }
 KiiConversionEvent* c1 = [experiment conversionEventAtIndex:0];
 NSDictionary* dict = [variation eventDictionaryForConversionWithName: [c1 name]];

 [KiiAnalytics trackEvent:[experiment experimentID] withExtras:dict];

Declared In

KiiVariation.h