Configure mParticle
How to send Optimizely Feature Experimentation experiment information from your Android and iOS apps to mParticle for further analysis.
NoteThis is a third-party integration and is not an Optimizely subprocessor. See Optimizely's Third-Party Add-Ons & Platform Integration Terms.
The mParticle integration uses the Optimizely Feature Experimentation DECISION notification listener and the legacy Activate, Get Enabled Features, Get Feature Variable, and Is Feature Enabled methods.
When any of these methods are called, this triggers the DECISION notification listener to send an event containing user, experiment, and variation data as input to mParticle. When the integration is complete, you can expect to see the event in your Optimizely input feed on the mParticle Live Stream dashboard within 3-5 minutes.
Before setting up Optimizely as input data for mParticle, you should review mParticle’s documentation on the Optimizely integration.
mParticle and Android
If you are getting started, read mParticle Getting Started guide for the Android SDK.
Step 1: Prerequisites
- Ensure the required experiment is running in Optimizely.
- Install the mParticle SDK with the additional Optimizely kit on the Android app.
Step 2: Enable the integration
The following example code sends an DECISION notification listener that contains information about the user, experiment, and variation to mParticle in an event called Experiment Viewed.
NoteYou can customize the event name and also specify which event tags are included in the event payload.
import com.mparticle.MParticle;
OptimizelyClient optimizelyClient = optimizelyManager.getOptimizely();
// Add a DECISION listener
int notificationId1 = optimizelyClient.addDecisionNotificationHandler(notification -> {
// Access type on decisionObject to get type of decision
String decisionType = notification.getType();
Map<String, ?> eventInfo = notification.getDecisionInfo();
MPEvent event = new MPEvent.Builder("Experiment Viewed", EventType.Transaction)
.duration(100)
.info(eventInfo)
.category("AB Test")
.build();
MParticle.getInstance().logEvent(event);
});mParticle and Optimizely integration using CocoaPods
You can add the mParticle - Optimizely integration kit to your iOS app using CocoaPods. For information, see the mParticle - Optimizely article on the CocoaPods website.
Test and troubleshoot
To verify the integration is working, check the Optimizely input feed of the mParticle Live Stream dashboard. You should see the sent event (Experiment Viewed, or your customized name) within 3-5 minutes after completing the integration. If you do not see the event, verify that your experiment is running correctly in Optimizely.
NotemParticle uses dollars and Optimizely uses cents. mParticle handles the conversion to dollars.
Unsupported platforms
Optimizely does not have a suggested solution for integrating mParticle with the following:
- Agent
- C# SDK
- Flutter SDK
- Go SDK
- Java SDK
- JavaScript SDK v6+
- JavaScript (Browser) SDK
- JavaScript (Node) SDK
- PHP SDK
- Python SDK
- React SDK
- React Native SDK
- Ruby SDK
Updated 10 days ago
