Advanced Matching

Beginning with the Facebook Core SDK version 4.36, you can perform advanced matching enabling you to send your customer data to Facebook. This matching increases the chances that you match actions in your mobile app with Facebook users. With this additional data, you can report and optimize your ads for more conversions and build larger re-marketing audiences.

Send data to Facebook using the SDKs or Adjust Mobile Measurement Partners (MMP).

When using the FB SDK, any user data will be hashed by the function and persist between app instances. All following app events will be transmitted as hashed user data. When using 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.

Customer Information Data Parameters

Data Parameter Example Format Guideline

City

ct

menlopark

City in lower case with spaces removed

Country

country

US

Two letter country code in ISO 3166-1 alpha-2

Date of Birth

db

19911226

Date of birth year, month, day, such as 19971226 for December 26, 1997

Email

em

jsmith@example.com

Lower case email address of person

First Name

fn

john

Lower case first name

Gender

ge

m

Either f or m, if unknown, leave blank

Last Name

ln

smith

Lower case last name

Phone

ph

16505551212

Phone number, only digits with country code, area code, and number

State

st

ca

Two letter state code

Zip

zp

94035

Five digit zip code

Android SDK Matching Example Code

Set User data while initializing AppEventsLogger. The user data will be hashed and persist between app instances. You can also hash the data with sha256 before putting it in the app event function. All following app events will include the hashed user data.

AppEventsLogger logger = AppEventsLogger.newLogger(MainActivity.this);
final Bundle userData = new Bundle();
userData.putString("em", "sha256_hashed_email");
userData.putString("ph", "sha256_hashed_phone");
userData.putString("fn", "sha256_hashed_first_name");
AppEventsLogger.setUserData(userData);

iOS SDK Matching Example Code

NSDictionary *const userData = @{
        @"em": @"sha256_hashed_email",
        @"ph": @"sha256_hashed_phone",
        @"fn": @"sha256_hashed_first_name"};
[FBSDKAppEvents setUserData:userData];

Adjust Mobile Measurement Partners

Add Customer Data to Adjust Events

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.

iOS Example Code

ADJEvent *event = [ADJEvent eventWithEventToken:@'abc123'];

[event addPartnerParameter:@'em' value:@'sha256_hashed_email'];
[event addPartnerParameter:@'ph' value:@'sha256_hashed_phone'];

[Adjust trackEvent:event];

Android Example Code

AdjustEvent event = new AdjustEvent('abc123');
event.addPartnerParameter('em', 'sha256_hashed_email');
event.addPartnerParameter('ph', 'sha256_hashed_phone');
Adjust.trackEvent(event);

For more information please visit the Github Code examples.

Map Adjust Parameters to Facebook Parameters

Use the following steps to map the Adjust parameter to the Facebook parameter in the Adjust dashboard.

  1. In your Adjust dashboard, click on the Settings of the app for which you wish to map the partner parameters.
  2. Select Partner Setup.
  3. Click on the partner of interest.
  4. Select Partner Parameter Mapping.
  5. Enter the partner parameter names as sent to Adjust by the SDK in the left FROM APP column. This should be the same for every partner. For example, if you are using email as parameter name in the Adjust SDK, then enter “email”.
  6. Enter the partner parameter names as desired by this partner in the right TO PARTNER column. This is partner specific. The parameter used in the Facebook SDK should be in format of ud[pii_type_name]. For example, "email" should use ud[em], phone should use ud[ph].

For more information, please visit the Adjust Documentation.