Class MixpanelOptions.Builder

java.lang.Object
com.mixpanel.android.mpmetrics.MixpanelOptions.Builder
Enclosing class:
MixpanelOptions

public static class MixpanelOptions.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • instanceName

      public MixpanelOptions.Builder instanceName(String 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

      public MixpanelOptions.Builder optOutTrackingDefault(boolean 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

      public MixpanelOptions.Builder superProperties(org.json.JSONObject 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

      public MixpanelOptions.Builder featureFlagsEnabled(boolean 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

      public MixpanelOptions.Builder featureFlagsContext(org.json.JSONObject 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

      public MixpanelOptions build()
      Builds and returns a MixpanelOptions instance with the configured settings.
      Returns:
      A new MixpanelOptions instance.