mixpanel / mixpanel-android

Official Android Tracking Library for Mixpanel Analytics
http://mixpanel.com/
Apache License 2.0
1.02k stars 366 forks source link

Add 'trackAutomaticEvents' as a required param in getInstance' and remove Mixpanel server api call for `Autotrack` setting #794

Closed zihejia closed 2 years ago

zihejia commented 2 years ago

Since this PR, we are deprecating the Automatically collect common mobile events setting from Mixpanel website in favor of reducing crashes and race conditions when collecting common mobile events.

image

Alternatively, you need to specify a new param trackAutomaticEvents in getInstance as belows:

...
* @param trackAutomaticEvents Whether or not to collect common mobile events
*                             include app sessions, first app opens, app updated, etc.
...
public static MixpanelAPI getInstance(Context context, String token, boolean trackAutomaticEvents)
public static MixpanelAPI getInstance(Context context, String token, boolean optOutTrackingDefault, boolean trackAutomaticEvents)
public static MixpanelAPI getInstance(Context context, String token, boolean optOutTrackingDefault, String instanceName, boolean trackAutomaticEvents)
public static MixpanelAPI getInstance(Context context, String token, JSONObject superProperties, boolean trackAutomaticEvents)
public static MixpanelAPI getInstance(Context context, String token, JSONObject superProperties, String instanceName, boolean trackAutomaticEvents)
public static MixpanelAPI getInstance(Context context, String token, boolean optOutTrackingDefault, JSONObject superProperties, String instanceName, boolean trackAutomaticEvents)