Add experiment properties to feature flag exposure tracking#875
Merged
jaredmixpanel merged 3 commits intomasterfrom Sep 24, 2025
Merged
Add experiment properties to feature flag exposure tracking#875jaredmixpanel merged 3 commits intomasterfrom
jaredmixpanel merged 3 commits intomasterfrom
Conversation
Contributor
Author
|
looks like some test flakes maybe, everything's passing locally |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for three new optional experiment tracking fields (experiment_id, is_experiment_active, is_qa_tester) from the Mixpanel flags API response to be included in the $experiment_started event tracking.
Key changes:
- Extends the MixpanelFlagVariant class with three new optional experiment tracking fields
- Updates flag parsing logic to extract these optional fields from API responses
- Modifies experiment tracking to include these fields when present
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| MPConstants.java | Adds string constants for the three new experiment tracking field keys |
| JsonUtils.java | Updates flag parsing to extract optional experiment fields from JSON response |
| MixpanelFlagVariant.java | Adds new fields and constructor overloads to support experiment tracking data |
| FeatureFlagManager.java | Updates tracking logic to include experiment fields in event properties |
| FeatureFlagManagerTest.java | Adds test coverage for the new experiment tracking functionality |
src/main/java/com/mixpanel/android/mpmetrics/MixpanelFlagVariant.java
Outdated
Show resolved
Hide resolved
Updated all Javadoc comments in MixpanelFlagVariant to correctly reference MixpanelFlagVariant instead of the old FeatureFlagData class name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plumbs ExperimentID, isExperimentActive, and isQATester, optional properties that may be present in the /flags API response, through to the tracked $experiment_started event.
GitHub Copilot Summary
This pull request adds support for optional experiment tracking parameters to feature flag variants in the Mixpanel Android SDK. The changes ensure that experiment-related fields (
experiment_id,is_experiment_active, andis_qa_tester) are parsed from API responses, stored in theMixpanelFlagVariantclass, and included in tracking event properties. A new test verifies that these fields are correctly handled end-to-end.Feature flag experiment tracking enhancements:
experimentID,isExperimentActive,isQATester) to theMixpanelFlagVariantclass, updated constructors to initialize them, and documented their purpose. [1] [2] [3] [4] [5]MPConstants.Flagsfor the new experiment tracking fields.Parsing and serialization improvements:
JsonUtils.parseFlagsResponseto extract the new experiment tracking fields from the API response and pass them to theMixpanelFlagVariantconstructor.createFlagsResponseJsonto include the optional experiment parameters when present.Tracking event property updates:
_performTrackingDelegateCallinFeatureFlagManagerto include the new experiment parameters in tracking event properties if available.Testing:
FeatureFlagManagerTestto verify that all optional experiment parameters are included in tracking event properties when present.