Apple has recently introduced a new question every developer is asked in iTunes Connect while creating app version. The new option is strictly connected with access to
ASIdentifierManager to obtain a unique ID – Advertising Identifier (
IDFA) – that is related to serving advertisements.
This article covers all the information you should know about the new policies, reasons behind introducing them, and DOs and DON’Ts to not get rejected while submitting the app.
What is IDFA?
Let’s decipher the acronym first.
IDFA stands for Identifier for Advertising. Apple documentation says that
IDFA is an identifier that can be used only for serving advertisements.
An alphanumeric string unique to each device, used only for serving advertisements.
It is similar to UIDevice’s property
identifierForVendor but (and that’s a very big but) its value is the same for all vendors. In short words, it uniquely identifies the iDevice. However it is not the same as an old
UDID which usage has been prohibited.
IDFA can change in special cases. For example when user erases the device.
When to use IDFA?
You should only use IDFA for advertising related purposes. It should not be used solely for uniquely identifying the device. Not obeying this rule might result in rejection of your app from the App Store. Basically, if your app shows advertisements, uses iAd, or responds to advertisements in any way, for example by submitting an event to your server to indicate that it was launched because user tapped on an iAd, you are good to go.
You can use IDFA for:
- frequency capping,
- conversion events,
- estimating the number of unique users,
- security and fraud detection,
Recent change in iTunes Connect added a new question the developer has to answer before marking the version as ready for upload.
Does this app use the Advertising Identifier (IDFA)?
YES results in showing three checkboxes where you can indicate why exactly your app needs to access the Advertising Identifier.
- Serve advertisements within the app.
- Attribute this app installation to a previously served advertisement.
- Attribute an action taken within this app to a previously served advertisement.
First option is self explanatory. Check this if you are showing advertisements in your app. Next two options cover various cases when your app is opened because of user interaction with an ad. A good example is sending the identifier to your advertising system to know about conversion.
How to use IDFA?
IDFA is simple.
ASIdentifierManager class provides methods for getting it and checking whether user has decided to opt out from ad tracking. In this case, returned
IDFA string is nil. The following code snippet shows how to obtain a string value of IDFA.
- (NSString *)identifierForAdvertising
if([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled])
NSUUID *IDFA = [[ASIdentifierManager sharedManager] advertisingIdentifier];
return [IDFA UUIDString];
Don’t forget to link with AdSupport framework. If you only target iOS 7 and above, you can add it using modules.
Apple takes security very seriously. New policies for collecting used specific information regarding advertising blend very well in it. User have now a choice to opt out from behavioral advertising. It is a move in the right direction.
If you have any questions or feel like some valuable information is missing here, please let me know about it in the comments.