Integrations for iOS

Google Analytics

Taplytics pushes experiment/variation info to the Google Analytics SDK in the following format:

id<GAITracker> tracker = [GAI sharedInstance].defaultTracker;
NSDictionary* experimentsAndVariations = @{
    @"Experiment 1": @"Variation 1",
    @"Experiment 2": @"baseline"
};
for (NSString* experimentName in experimentsAndVariations.allKeys) {
    NSString* variationName = experimentsAndVariations[experimentName];
    [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"TL_experiments"
                                           action:experimentName
                                            label:variationName
                                            value:nil] build]];
}
weak var tracker = GAI.sharedInstance().defaultTracker
let experimentsAndVariations = [
    "Experiment 1": "Variation 1",
    "Experiment 2": "baseline"
]
for experimentName in experimentsAndVariations.keys {
    let variationName = experimentsAndVariations[experimentName]
    tracker?.send(GAIDictionaryBuilder.createEvent(withCategory: "TL_experiments", action: experimentName, label: variationName, value: nil).build())
}

Flurry

Taplytics logs experiment/variation events to the Flurry iOS SDK as follows:

NSDictionary* experimentsAndVariations = @{
    @"Experiment 1": @"Variation 1",
    @"Experiment 2": @"baseline"
};
[Flurry logEvent:@"TL_experiments" withParameters:experimentsAndVariations];
let experimentsAndVariations = [
    "Experiment 1": "Variation 1",
    "Experiment 2": "baseline"
]
Flurry.logEvent("TL_experiments", withParameters: experimentsAndVariations)

MixPanel

As of SDK version 3.3.0, Taplytics sets experiment/variation data to the Mixpanel iOS SDK as a super property called TL_Experiments. The super properties contain an array of strings with the format:

["Experiment 1":"Variation3", "Experiment 2": "Variation 9", ...]

For SDK versions 3.2.0 and below, Taplytics tracks experiment/variation events to the Mixpanel iOS SDK as follows:

NSDictionary* experimentsAndVariations = @{
    @"Experiment 1": @"Variation 1",
    @"Experiment 2": @"baseline"
};
[[Mixpanel sharedInstance] track:@"TL_experiments" properties:experimentsAndVariations];
[[Mixpanel sharedInstance] registerSuperProperties:experimentsAndVariations];
let experimentsAndVariations = [
    "Experiment 1": "Variation 1",
    "Experiment 2": "baseline"
]
Mixpanel.sharedInstance().track("TL_experiments", properties: experimentsAndVariations)
Mixpanel.sharedInstance().registerSuperProperties(experimentsAndVariations)

Amplitude

As of SDK version 2.52.0, Taplytics sets experiment/variation data to the Amplitude iOS SDK as a user property called TL_Experiments. The user properties contain an array of strings with the format:

["Experiment 1":"Variation3", "Experiment 2": "Variation 9", ...]

If you'd like to log them as an event with event properties instead, use the new start option below. The name and format of the data will be the same as versions 2.51.2 and below.

TaplyticsOptionAmplitudeExpsAsEvents

For SDK versions 2.51.2 and below, Taplytics tracks experiment/variation events to the Amplitude iOS SDK as follows:

NSDictionary* experimentsAndVariations = @{
    @"Experiment 1": @"Variation 1",
    @"Experiment 2": @"baseline"
};

[[Amplitude instance] logEvent:@"TL_Experiments" withEventProperties:experimentsAndVariations];
let experimentsAndVariations = [
    "Experiment 1": "Variation 1",
    "Experiment 2": "baseline"
]

Amplitude.instance().logEvent("TL_Experiments", withEventProperties: experimentsAndVariations)

Adobe

Taplytics logs experiment/variation events to the Adobe Omniture iOS SDK as follows:

NSDictionary* experimentsAndVariations = @{
    @"Experiment 1": @"Variation 1",
    @"Experiment 2": @"baseline"
};
[ADBMobile trackAction:@"TL_experiments" data:experimentsAndVariations];
let experimentsAndVariations = [
    "Experiment 1": "Variation 1",
    "Experiment 2": "baseline"
]
ADBMobile.trackAction("TL_experiments", data: experimentsAndVariations)

Localytics

Taplytics logs experiment/variation events to the Localytics iOS SDK as follows:

NSDictionary* experimentsAndVariations = @{
    @"Experiment 1": @"Variation 1",
    @"Experiment 2": @"baseline"
};
[[LocalyticsSession shared] tagEvent:@"TL_experiments" attributes:experimentsAndVariations];
let experimentsAndVariations = [
    "Experiment 1": "Variation 1",
    "Experiment 2": "baseline"
]
LocalyticsSession.shared().tagEvent("TL_experiments", attributes: experimentsAndVariations)

Segment

Taplytics logs experiment/variation events to the Segment iOS SDK as follows:

NSDictionary* experimentsAndVariations = @{
    @"Experiment 1": @"Variation 2"
};

[[SEGAnalytics sharedAnalytics] track:@"Experiment Viewed" properties:experimentsAndVariations];
let experimentsAndVariations = [
    "Experiment 1": "Variation 2"
]

SEGAnalytics.shared().track("Experiment Viewed", properties: experimentsAndVariations)

Please note that unlike other integrations, segment expects multiple events. The above example is how a single one is sent.


Intercom

Taplytics logs experiment/variation events with Intercom in the following format:

NSDictionary* experimentsAndVariations = @{
    @"Experiment 1": @"Variation 1",
    @"Experiment 2": @"baseline"
};
[Intercom logEventWithName:@"TL_experiments" optionalMetaData:experimentsAndVariations];
let experimentsAndVariations = [
    "Experiment 1": "Variation 1",
    "Experiment 2": "baseline"
]
Intercom.logEvent(withName: "TL_experiments", optionalMetaData: experimentsAndVariations)

Apsalar

Taplytics logs experiment/variation events to the Apsalar iOS SDK as follows:

NSDictionary* experimentsAndVariations = @{
    @"Experiment 1": @"Variation 1",
    @"Experiment 2": @"baseline"
};
[Apsalar event:@"TL_experiments" withArgs:experimentsAndVariations];
let experimentsAndVariations = [
    "Experiment 1": "Variation 1",
    "Experiment 2": "baseline"
]
Apsalar.event("TL_experiments", withArgs: experimentsAndVariations)

Parse

Taplytics logs experiment/variation events to the Parse iOS SDK as follows:

NSDictionary* experimentsAndVariations = @{
    @"Experiment 1": @"Variation 1",
    @"Experiment 2": @"baseline"
};
[PFAnalytics trackEvent:@"TL_experiments" dimensions:experimentsAndVariations];
let experimentsAndVariations = [
    "Experiment 1": "Variation 1",
    "Experiment 2": "baseline"
]
PFAnalytics.trackEvent("TL_experiments", dimensions: experimentsAndVariations)

Heap

Taplytics logs experiment/variation events to the Heap iOS SDK as follows:

NSDictionary* experimentsAndVariations = @{
    @"Experiment 1": @"Variation 1",
    @"Experiment 2": @"baseline"
};
[Heap track:@"TL_Experiments" withProperties:experimentsAndVariations];
let experimentsAndVariations = [
    "Experiment 1": "Variation 1",
    "Experiment 2": "baseline"
]
Heap.track("TL_Experiments", withProperties: experimentsAndVariations)

KISSMetrics

Taplytics logs experiment/variation events to the Kissmetrics iOS SDK as follows:

NSDictionary* experimentsAndVariations = @{
    @"Experiment 1": @"Variation 1",
    @"Experiment 2": @"baseline"
};
[[KISSmetricsAPI sharedAPI] record:@"TL_Experiments" withProperties:experimentsAndVariations];
let experimentsAndVariations = [
    "Experiment 1": "Variation 1",
    "Experiment 2": "baseline"
]
KISSmetricsAPI.shared().record("TL_Experiments", withProperties: experimentsAndVariations)

Firebase

Taplytics logs experiment/variation events to the Firebase iOS SDK as follows:

NSDictionary* experimentsAndVariations = @{
    @"Experiment 1": @"Variation 1",
    @"Experiment 2": @"baseline"
};
[FIRAnalytics logEventWithName:@"TL_Experiments" parameters:experimentsAndVariations];
let experimentsAndVariations = [
    "Experiment 1": "Variation 1",
    "Experiment 2": "baseline"
]
FIRAnalytics.logEvent(withName: "TL_Experiments", parameters: experimentsAndVariations)