At a glance: Learn how to technically opt-out users out of AppsFlyer SDK measurement, for GDPR, CCPA, or other scenarios related to user privacy.
Opt-out
This article is for the use of AppsFlyer clients and is not intended for app users. If you are an app user and want to opt-out, you need to contact the app publisher (owner).
All data subjects have the Right to Restriction of Processing of their data. When data subjects exercise this right, data controllers must stop processing the subjects’ personal data under all circumstances, including removing the users from all direct marketing.
To shut down all SDK functions on a mobile device use the isStopTracking API. Once this API is invoked, the AppsFlyer SDK stops functioning and no longer sends any information to the AppsFlyer servers.
Developer code
Details for developers are set out below.
Android opt-out
Available from Android SDK v. 4.8.7.
AppsFlyerLib.getInstance().stopTracking(true, context);
In any event, the SDK can be reactivated by calling the same API, but to pass false.
Warning
Use this API only in cases where you want to fully block a user from any AppsFlyer SDK functions. Using this API SEVERELY impacts your reporting and attribution.
iOS opt-out (V5)
Available from iOS SDK v. 4.8.3.
AppsFlyerTracker.shared().isStopTracking = true
[AppsFlyerTracker sharedTracker].isStopTracking = true;
iOS opt-out (V6)
Available from iOS SDK v. 4.8.3.
AppsFlyerLib.shared().isStopped = true
[AppsFlyerLib shared].isStopped = true;
Unity opt-out (V4)
Use this API during the SDK Initialization to explicitly opt-out:
public void setDeviceTrackingDisabled(boolean isDisabled);
Usage Example:
AppsFlyer.setDeviceTrackingDisabled(true);
SDK functions can be restarted by calling deviceTrackingDisabled
again set to false.
Warning
Opting out users SEVERELY hurts your attribution information.Use this option ONLY for regions that legally prevent you from collecting your users' information.
Unity opt-out (V5 and above)
Use this API during the SDK Initialization to explicitly opt-out:
void anonymizeUser(bool shouldAnonymizeUser)
Usage Example:
AppsFlyer.anonymizeUser(true);
SDK functions can be restarted by calling anonymizeUser
again set to false.
Warning
Opting out users SEVERELY hurts your attribution information.Use this option ONLY for regions that legally prevent you from collecting your users' information.
Learn about different opt-out scenarios and how to implement them.