Official Android Tracking Library for Mixpanel Analytics
This major release removes all remaining calls to Mixpanel's /decide
API endpoint. The main effect of this is that the SDK no longer fetches the remote status of your project's "Automatically collect common mobile events" setting. From this version forward, automatic event tracking can only be controlled by the, now required, parameter trackAutomaticEvents
. Upon upgrading, existing implementations will need to add this parameter to their Mixpanel initializer calls.
Autotrack
setting #794
* Set maximum number of events/updates to send in a single network request
*
* @param flushBatchSize int, the number of events to be flushed at a time, defaults to 50
*/
public void setFlushBatchSize(int flushBatchSize);
/**
* Set an integer number of bytes, the maximum size limit to the Mixpanel database.
*
* @param maximumDatabaseLimit an integer number of bytes, the maximum size limit to the Mixpanel database.
*/
public void setMaximumDatabaseLimit(int maximumDatabaseLimit);
You can also set them in AndroidManifest.xml
, i.e.
<meta-data android:name="com.mixpanel.android.MPConfig.FlushBatchSize"
android:value="5" />
<meta-data android:name="com.mixpanel.android.MPConfig.MaximumDatabaseLimit"
android:value="100000000" />
instanceName
in getInstance
#792
This release adds the following APIs to MixpanelAPI:
/**
...
* @param instanceName The name you want to uniquely identify the Mixpanel Instance.
It is useful when you want more than one Mixpanel instance under the same project token.
...
**/
getInstance(Context context, String token, String instanceName)
getInstance(Context context, String token, boolean optOutTrackingDefault, String instanceName)
getInstance(Context context, String token, JSONObject superProperties, String instanceName)
getInstance(Context context, String token, boolean optOutTrackingDefault, JSONObject superProperties, String instanceName)
Please note: If you are going to add instanceName
to getInstance
on your existing implementation. getInstance
will start using instanceName
as the instance identifier rather than token
, so you might lose some of the stored properties including the distinct Id under the token
. We'd recommend using it when you need to create more than one instance under the same project token. You won't lose any events and user profile updates.