Audiences—additional identifiers

At a glance: Configure additional user identifiers for sending custom audiences to advertising partners.

Background

AppsFlyer Audiences automatically supports the following device identifiers for sending custom audiences to advertising partners:

  • iOS: IDFA
  • Android (Google Play): GAID
  • Android (3rd-party app stores): OAID and IMEI

Some advertising partners also support custom audience matching based on additional user identifiers. Audiences offers you the option to utilize these identifiers if you specifically configure them through the AppsFlyer SDK or S2S-mobile API.

Such additional identifiers may include names, email, and similar identifiers but can only be used if encrypted with SHA256 hashing.  Your use of such additional identifiers is subject to the Additional Identifiers Terms of Use.

Next Steps

  1. Select the additional identifiers you want to use (if any) from the table of available identifiers. Note that not all advertising partners support all identifiers.
  2. DevelopersConfigure the selected identifiers, using:
  3. In the Audiences dashboard:

Available identifiers

You can elect to configure one or more identifiers, shown in the table below.

Additional identifiersparameters and formatting

Identifier Parameter name Format Example value (before hashing)
Email address email_sha256
  • Lowercase
  • No white spaces
  • SHA256 hashed
name@domain.com
Phone number
(see note below)
phone_number_sha256
  • No symbols, letters, or leading zeroes
  • Include country code
  • SHA256 hashed
442070313000

Phone number E164

(see note below)

phone_number_e164_sha256
  • E164 phone number
  • SHA256 hashed
+442070313000

 Note 

Different advertising partners support different phone number formats. So, if you choose to utilize phone number, configure both identifiers: Phone number and Phone number E164.

SDK reference and code samples

When sending identifiers for Audiences via the SDK:

  • For identifiers other than hashed Email address, use setAdditionalData
  • For hashed Email address, use setUserEmails

iOS SDK configuration

To set hashed Phone number as an additional user identifier:

Objective-C Swift
NSDictionary *customData = @{
  @"audiences": @{
    @"phone_number_sha256": @"6C91C4C640F6EF0162833260DB4F13DEC0DF2B683092F4DBA7E874BEF1ACEA37",
    @"phone_number_e164_sha256":@"F3D7E96C73FB0DE1B66ACFCE541D7AF758FBD4F3FA3AF0EA4E10110000D3625E"
  }
};
[[AppsFlyerLib shared] setAdditionalData:customData];

To set hashed Email address as an additional user identifier:

Method signature

- (void)setUserEmails:(NSArray<NSString *> *_Nullable)userEmails 
withCryptType:(EmailCryptType)type;

Usage example

Objective-C Swift
NSArray *emails = @[@"name@domain.com"];    
[[AppsFlyerLib shared] setUserEmails:emails withCryptType:EmailCryptTypeSHA256];

Android SDK configuration

To set hashed Phone number as an additional user identifier:

Java Kotlin
HashMap<String, Object> audiences = new HashMap<>();
audiences.put("phone_number_sha256", "6C91C4C640F6EF0162833260DB4F13DEC0DF2B683092F4DBA7E874BEF1ACEA37");
audiences.put("phone_number_e164_sha256", "F3D7E96C73FB0DE1B66ACFCE541D7AF758FBD4F3FA3AF0EA4E10110000D3625E");
HashMap<String, Object> customDataMap = new HashMap<>();
customDataMap.put("audiences", audiences);
AppsFlyerLib.getInstance().setAdditionalData(customDataMap);

To set hashed Email address as an additional user identifier:

Method signature

public abstract void setUserEmails(
  AppsFlyerProperties.EmailsCryptType cryptMethod,
  String... emails
);

Usage example

JavaKotlin
AppsFlyerLib.getInstance().setUserEmails(
  AppsFlyerProperties.EmailsCryptType.SHA256,
  "name@domain.com",
  "another_name@another_domain.com"
);

S2S reference and code samples

When sending identifiers for Audiences via S2S, use the custom_data parameter for all identifiers (including hashed Email address). You can send one or more identifiers.

Sending identifiers via S2S

Format:

  • Nested JSON
  • The key value must be audiences
  • All values must be stringified as shown in the following code example
  • Parameter names must match those listed in the table of available identifiers above

Generic format:

"custom_data" : { 
\"audiences\" : { \"parameter_name_a\" : \"hashed_identifer_a\", \"parameter_name_a\" : \"hashed_identifer_b\", \"parameter_name_c\" : \"hashed_identifer_c\" } }

Populated example for hashed Phone number and hashed Email address:

"custom_data" : {
\"audiences\" : { \"phone_number_sha256\" : \"6C91C4C640F6EF0162833260DB4F13DEC0DF2B683092F4DBA7E874BEF1ACEA37\", \"phone_number_e164_sha256\" : \"F3D7E96C73FB0DE1B66ACFCE541D7AF758FBD4F3FA3AF0EA4E10110000D3625E\", \"email_sha256\" : \"34D31BE18022626DE6B311D6A76E791176D2691B6EEF406F524D8F56364C187A\" } }
Was this article helpful?