Preserve user privacy

Learn how to preserve user privacy in the iOS SDK.

Privacy-preserving methods: When, Who, and What to send

The SDK lets you control three things about the data you send to AppsFlyer:

  • When you send user-level data
  • Who receives user-level data
  • What user-level data you send

When to send user-level data

The SDK sends information about app installs and in-app events to AppsFlyer as soon as start is called. Privacy-preserving methods affect the availability of certain user-level event data depending on whether they're invoked before or after the start call.

When start is called for the first time, the SDK sends the install event to AppsFlyer, along with the parameters required to attribute the installation to the correct media source. Invoking privacy-preserving methods before calling start can prevent AppsFlyer from attributing the install event properly.

So, if you want attribution to occur, avoid calling privacy-preserving methods before start. Instead, call them only after the install event has been sent to AppsFlyer. This approach ensures that the user's in-app events remain private while install attribution can still take place.

Who receives user-level data

Your ad network and Self-Reporting Network (SRN) partners receive user-level data for attribution and optimization. Use a partner-sharing filter method, below, to limit which partners receive this data based on end-user preference.

What data to send

Some methods below anonymize data by deleting or hashing all user-level identifiers. Others remove only specific identifiers.

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 identifierDescription
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.


Did this page help you?