Source only
This Integration is a source only, meaning you can use it to send data from Optimizely Full-Stack to Heap, but not the opposite.
Custom development required
This integration requires custom development. You’ll need to work with a developer to use our APIs to bring data into Heap.
Once the Optimizely and Heap SDKs have been installed, you can use the following code snippet to track experiment data into Heap.
let activateNotificationId = optimizely.notificationCenter?.addActivateNotificationListener(activateListener: { (experiment, userId, attributes, variation, logEvent) in
guard let experimentKey = experiment["key"] as? String else { return }
guard let variationKey = variation["key"] as? String else { return }
// Set "user property" for the user
let propertyKey = "[Optimizely] " + experimentKey
Heap.addUserProperties([propertyKey : variationKey])
})
For more information, see Optimizely’s developer documentation.