This document explains how to send your app events user data to Facebook for Advanced Matching. This information gets hashed before it is shared with us. We use the hashed information to more accurately determine which people took action in response to your ad. With this data, Facebook can match conversion events to your customers to optimize your ads and build larger re-marketing audiences.
After matching has taken place, Facebook promptly discards the hashed data.
You can set up Advanced Matching using one of the following methods:
When using the FB SDK to send user app events data to Facebook, all user data will be hashed. This hashed data persist between app instances.
Set user data while initializing AppEventsLogger
with the setUserData
function. This function will hash the user data.
AppEventsLogger logger = AppEventsLogger.newLogger(MainActivity.this); AppEventsLogger.setUserData( “jsmith@example.com”, //email “john”, //first name “smith”, //last name “16505554444”, //phone number “19910526”, //birthdate “f”, //gender “menlopark”, //city “ca”, //state “94025”, //zip code “us” //country );
Set user data while initializing FBSDKAppEvents
with the setUserData
function. The user data will be hashed and will persist between app instances.
Events that your app collects and sends to Facebook may require you to disclose these data types in the App Store Connect questionnaire. It is your responsibility to ensure this is reflected in your application’s privacy policy. Visit the Apple App Store Privacy Details article to learn more about the data types you will need to disclose.
[FBSDKAppEvents setUserData: @"jsmith@example.com" forType:FBSDKAppEventEmail];
NSDictionary *const userData = @{ @"em": @"jsmith@example.com", @"fn": @"john", @"ln": @"smith", @"ph": @"16505554444", @"db": @"19910526", @"ge": @"f", @"ct": @"menlopark", @"zp": @"94025", @"cn": @"us"}; [FBSDKAppEvents setUserEmail:(NSString *)userData["@em"] firstName:(NSString*)userData["@fn"] lastName:(NSString *)userData[@"ph"] phone:(NSString *)userData[@"ph"] dateOfBirth:(NSString *)userData[@"db"] gender:(NSString *)userData[@"ge"] city:(NSString *)userData[@"ct"] state:(NSString *)userData[@"st"] zip:(NSString *)userData[@"zp"] country:(NSString *)userData[@"cn"]];
User Data | Parameter | Format | Example |
---|---|---|---|
|
| ||
First Name |
| Lowercase letters |
|
Last Name |
| Lowercase letters |
|
Phone |
| Digits only including country code and area code |
|
External ID |
| Any unique ID from the advertiser, such as loyalty membership ID, user ID, and external cookie ID. |
|
Gender |
| Single lowercase letter, |
|
Birthdate |
| Digits only with birth year, month, then day |
|
City |
| Lowercase with any spaces removed |
|
State or Province |
| Lowercase two-letter state or province code |
|
Zip or Postal Code |
| Digits only |
|
Country |
| Lowercase two-letter country code |
|
Automatic Advanced Matching automatically configures your Facebook SDK to detect and receive user data along with the event, or action, that took place in your app. This data is hashed before sending it to Facebook.
To turn on Automatic Advanced Matching, go to your Events Manager, select your app's Settings tab and toggle Automatic Advanced Matching to ON. You can also share hashed email addresses and phone numbers.
Note, you must have implemented the Facebook SDK 5.8.0 or later.
When using the Adjust Mobile Measurement Partners (MMP) SDK, please use the hash function as shown in the example below, as the MMP SDK won't hash it automatically. If you don't use a hash function our API will throw an exception and not accept plain text.
Add customer data parameters to be transmitted to network partners, which have been activated in your Adjust dashboard, by calling the addPartnerParameter
method on your ADJEvent
instance.
Note, you do not need to implement the Facebook SDK.
AdjustEvent event = new AdjustEvent('abc123'); event.addPartnerParameter('em', 'sha256_hashed_email'); event.addPartnerParameter('ph', 'sha256_hashed_phone'); Adjust.trackEvent(event);
ADJEvent *event = [ADJEvent eventWithEventToken:@'abc123']; [event addPartnerParameter:@'em' value:@'sha256_hashed_email']; [event addPartnerParameter:@'ph' value:@'sha256_hashed_phone']; [Adjust trackEvent:event];
For more information please visit the Github Code examples.
Use the following steps to map the Adjust parameter to the Facebook parameter in the Adjust dashboard.
email
as parameter name in the Adjust SDK, then enter “email”. ud[pii_type_name]
. For example, "email" should use ud[em]
, phone should use ud[ph]
. For more information, please visit the Adjust Documentation.