Preserve user privacy

Learn how to preserve user privacy in the iOS SDK.

Getting Started on Privacy Preservation

For a general introduction to privacy-preserving methods in the AppsFlyer SDK, see Preserving user privacy (under Getting started).

Use start to share only the install event

If you prefer to send only the install event and no additional information, you can invoke start, with a completion handler. Once you receive a success response indicating that the install event has been received, either set isStopped or anonymizeUser to true in the completion handler.

  • anonymizeUser = true sends data to AppsFlyer, but upon reaching AppsFlyer, all identifiers, including the IP address, are removed or hashed.
  • isStopped = true reverts the start call, thereby preventing the SDK from sending out any data to AppsFlyer.
AppsFlyerLib.shared().start(completionHandler: { (dictionary, error) in
    if (error != nil){
        print(error ?? "")
        return
    } else {
        AppsFlyerLib.shared().isStopped = true
        return
    }
})

Prevent sharing data with third parties

If you want to prevent sharing install and in-app event information with third parties such as SRNs and ad networks, use the setSharingFilterForPartners method before calling start. Partners that are excluded with this method will not receive data through postbacks, APIs, raw data reports, or any other means.

Note: You can call setSharingFilterForPartners again if the user changes the app sharing settings (adding or removing partners) later in the session.
For a code example please refer to setSharingFilterForPartners.

Anonymize user information

You can configure the SDK to instruct AppsFlyer to remove all user-identifying information by using the anonymizeUser method. In this case, the SDK sends install and in-app events to AppsFlyer, where all identifying information is then deleted or hashed:

  • Deleted: personal identifiers (GAID, IDFA, IDFV, and CUID)
  • Hashed: AppsFlyer ID and IP address.

To learn how to implement the method without anonymizing install events, see: share only the install event

Disable IDs

The SDK is capable of sending several specific identifiers to AppsFlyer. You can choose to exclude them in accordance to your needs.

Note: Disabling the advertiser ID before calling start will prevent SRN attribution.

Disable identifierОписание
disableAdvertisingIdentifier Disables the collection of IDFA by the SDK (iOS 14 and below). From iOS 14.5, access to IDFA is managed by the App Tracking Transparency framework.
disableIDFVCollectionDisables the collection of IDFV by the SDK.

Send data only after the user opts-in

In cases where you would like to not send any data to AppsFlyer until the user gives consent, defer calling start until after the consent is given.