Mixpanel disable tracking in certain environment for iOS app

928 Views Asked by At

I would like to disable tracking by Mixpanel when the app is in development profile. This can be done easily in Google Analytics for iOS by calling a method to disable tracking . But for Mixpanel for iOS ,I couldn't find a similar method. Any idea how to implement this ?

Thanks

2

There are 2 best solutions below

1
On BEST ANSWER

You can just not initialize MixPanel, by using the DEBUG define like:

#ifndef DEUGB // Debug is not defined 
   [Mixpanel sharedInstanceWithToken:MIXPANEL_TOKEN];
#ednif
0
On

You're actually encouraged to create a separate project for debugging / development ProjectName-Develop Then if DEBUG is defined, use that project's API token.