Package com.mixpanel.android.mpmetrics
Class MixpanelOptions.Builder
java.lang.Object
com.mixpanel.android.mpmetrics.MixpanelOptions.Builder
- Enclosing class:
- MixpanelOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds and returns aMixpanelOptions
instance with the configured settings.featureFlagsContext
(org.json.JSONObject featureFlagsContext) Sets the context to be used for evaluating feature flags.featureFlagsEnabled
(boolean featureFlagsEnabled) Enables or disables the Mixpanel feature flags functionality.instanceName
(String instanceName) Sets the distinct instance name for the MixpanelAPI.optOutTrackingDefault
(boolean optOutTrackingDefault) Sets the default opt-out tracking state.superProperties
(org.json.JSONObject superProperties) Sets the super properties to be sent with every event.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
instanceName
Sets the distinct instance name for the MixpanelAPI. This is useful if you want to manage multiple Mixpanel project instances.- Parameters:
instanceName
- The unique name for the Mixpanel instance.- Returns:
- This Builder instance for chaining.
-
optOutTrackingDefault
Sets the default opt-out tracking state. If true, the SDK will not send any events or profile updates by default. This can be overridden at runtime.- Parameters:
optOutTrackingDefault
- True to opt-out of tracking by default, false otherwise.- Returns:
- This Builder instance for chaining.
-
superProperties
Sets the super properties to be sent with every event. These properties are persistently stored.- Parameters:
superProperties
- A JSONObject containing key-value pairs for super properties. The provided JSONObject will be defensively copied.- Returns:
- This Builder instance for chaining.
-
featureFlagsEnabled
Enables or disables the Mixpanel feature flags functionality.- Parameters:
featureFlagsEnabled
- True to enable feature flags, false to disable.- Returns:
- This Builder instance for chaining.
-
featureFlagsContext
Sets the context to be used for evaluating feature flags. This can include properties like distinct_id or other custom properties.- Parameters:
featureFlagsContext
- A JSONObject containing key-value pairs for the feature flags context. The provided JSONObject will be defensively copied.- Returns:
- This Builder instance for chaining.
-
build
Builds and returns aMixpanelOptions
instance with the configured settings.- Returns:
- A new
MixpanelOptions
instance.
-