Skip to content

Conversation

@efahk
Copy link
Contributor

@efahk efahk commented Sep 22, 2025

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, and is_qa_tester) are parsed from API responses, stored in the MixpanelFlagVariant class, and included in tracking event properties. A new test verifies that these fields are correctly handled end-to-end.

Feature flag experiment tracking enhancements:

  • Added new fields (experimentID, isExperimentActive, isQATester) to the MixpanelFlagVariant class, updated constructors to initialize them, and documented their purpose. [1] [2] [3] [4] [5]
  • Updated the constants in MPConstants.Flags for the new experiment tracking fields.

Parsing and serialization improvements:

  • Modified JsonUtils.parseFlagsResponse to extract the new experiment tracking fields from the API response and pass them to the MixpanelFlagVariant constructor.
  • Updated the test helper method createFlagsResponseJson to include the optional experiment parameters when present.

Tracking event property updates:

  • Enhanced _performTrackingDelegateCall in FeatureFlagManager to include the new experiment parameters in tracking event properties if available.

Testing:

  • Added a new test to FeatureFlagManagerTest to verify that all optional experiment parameters are included in tracking event properties when present.

@efahk
Copy link
Contributor Author

efahk commented Sep 23, 2025

looks like some test flakes maybe, everything's passing locally

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Collaborator

@jaredmixpanel jaredmixpanel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Updated all Javadoc comments in MixpanelFlagVariant to correctly reference MixpanelFlagVariant instead of the old FeatureFlagData class name.
@jaredmixpanel jaredmixpanel merged commit 2cef90c into master Sep 24, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants