Affected: Experimentation Results
Symptoms
The context is successfully evaluated by the Experimentation flag, and metric events are visible in the LaunchDarkly UI. However, conversion counts are not being reflected in the experiment results.
Cause
There are a few common causes for this issue:
Mismatch in Randomization Unit:
Your experiment may be using a different randomization unit (context kind) than your metric, resulting in unmatched data.Incorrect Segment (Twilio) Mapping:
Your segment destination mappings may not align with the context kind used in LaunchDarkly Experimentation.
Solution
Ensure Matching Randomization Units
When configuring Experimentation in LaunchDarkly, the randomization unit (context kind) used in the experiment must match the metric’s randomization unit.
For example:
If you are using a custom context kind like device (instead of the default user), make sure both your experiment and your metric reference the device context kind.
Configure both:
The experiment design
- The associated metric to use the device as the randomization unit.
Verify Segment (Twilio) Integration Mapping
Assuming you've already configured the Segment integration with LaunchDarkly, follow these steps to verify your mapping: How to connect Segment to LaunchDarkly
Steps:
-
In Segment, go to:
Destinations → Your LaunchDarkly Destination → Mappings
Select Edit Track Events.
Check that the mapping aligns with your context kind.
LaunchDarkly correlates Segment metric events with LaunchDarkly context keys using the Segment user ID, if it is present. The Segment user ID must match a LaunchDarkly context key. If the Segment event does not contain a Segment user ID, then LaunchDarkly uses the Segment anonymous ID.
💡 Important:
If your experiment uses contextKind: device, ensure that Segment’s anonymousId is correctly mapped to the device or the corresponding context kind in LaunchDarkly.
Once all three components (Experiment, Metric, and Segment event mapping) align on the device context kind, LaunchDarkly will correctly register custom metrics for conversion tracking.