You can create ads targeting people by customer lists, and one way to make such a list is by using mobile advertiser IDs. A mobile advertiser ID is an Apple or Android Advertising Identifier or a Facebook App Scoped ID. This page explains how you can get these IDs and how you can use them when creating custom audiences for your app ads.
Before you start, please read Targeting by Customer Lists.
Identify when you want to access app scoped IDs. For example, you can access the ID when your app launches or when the user takes a certain action, such as making an in-app purchase.
There are several technologies you can use to identify a person:
We give code examples for all of these techniques below.
After you collect the IDs, store them in a database of your choice, or in an Excel or .csv file.
The Facebook Ads Manager requires you to provide your data as an Excel or .csv file. Most database systems can export to one of these formats.
Follow our Targeting by Customer Lists guide. Use the Excel or .csv file when it is time to import the customer list.
We support three types of Mobile Advertiser IDs:
ID | Description |
---|---|
Apple Advertising Identifier (IDFA) | An advertising ID that Apple provides as part of iOS in its ads framework. |
Android Advertising ID | An advertsing ID that Google provides as part of Google Play services. |
Facebook App Scoped ID | If people are logged in to your app via Facebook, you can use their App Scoped IDs for targeting. |
// This call does NOT require the Facebook SDK for iOS
#import <AdSupport/ASIdentifierManager.h>
NSString *userId = [[[ASIdentifierManager sharedManager]
advertisingIdentifier] UUIDString];
// Next: Store the user ID in your database
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
- (void)viewDidLoad
{
// Enable profile updates for example in `viewDidLoad`
[FBSDKProfile enableUpdatesOnAccessTokenChange:YES];
}
- (void)yourSelector
{
// Once user is logged in via Facebook Login you can call:
NSString *userId = [FBSDKProfile currentProfile].userID;
// Next: Store the ID in your database
}