What is IDFA


What is it ?

The Identifier For Advertisers is an alphanumeric string generated by an iOS device.

It is the same for all apps and publishers and should be used only for serving advertisements.

But this value is non-permanent and can be regenerated by the end user.

Usually it should be used by developers to improve the target of their ads (based on interests or not).

To reset the IDFA on an iPhone, open the Settings app and go to:

Settings  Privacy  Advertising  Reset Advertising Identifier

Retrieve the identifier

First, you need to check if the user has enabled ad tracking. Only if he did so, you can use the IDFA.

You can check it by calling isAdvertisingTrackingEnabled method of ASIdentifierManager.

From the official documentation:

isAdvertisingTrackingEnabled

Check the value of this property before performing any advertising tracking. If the value is false, use the advertising identifier only for the following purposes: frequency capping, attribution, conversion events, estimating the number of unique users, advertising fraud detection, and debugging.

On Xcode, import the AdSupport.framework and use this function:

import AdSupport

func currentIDFA() -> String? {
    // Check if Advertising Tracking is Enabled
    if (ASIdentifierManager.sharedManager().advertisingTrackingEnabled == true) {
        // Get and return the IDFA
        return = ASIdentifierManager.sharedManager().advertisingIdentifier.UUIDString
    }
    return nil
}

Does your app need it ?

Sometimes, even though you did not use the IDFA directly into your app, a third party library might have. Usually Google Analytics and Facebook SDK always requires the advertising identifier.

There is an easy way to verify whether you need to include it on iTunes Connect or not.

Within the command line, go to your project/workspace folder and run the following command to find which files are using the advertising identifier.

$> fgrep -R advertisingIdentifier .

Submit an app on iTunesConnect

App Submission

If your app does need the IDFA then you must inform Apple while submitting an app on iTunesConnect.

To do so, first check YES when asked if this app uses the Advertising Identifier (IDFA) ?

_config.yml

Then you will need to give more information about how you this identifier:

_config.yml

But what does this all mean ?

Checkbox Description
Serve advertising within the app Does your app display advertising banner?
Attribute this app installation to a previously served advertisement Can your app be installed through advertisings, for example on Facebook?
Attribute an action taken within this app to a previously served advertisement Do you track some events within the app: view tracking, user opens an ad, etc. ?
I, confirm that this app, ... Usual terms and conditions checkbox

App Rejection

If you did not enable the checkboxes and if Apple determines that your app does use IDFA, your app will be put into the Invalid Binary status, and you will be notified by email.

Similarly, if you checked them but your app uses IDFA in ways that do not match the statements you checked, your app will be rejected by App Review and put into the Rejected status.

In either case, when you resubmit the build, you will be presented with the IDFA questions again and can provide the appropriate answers.