Advanced Matching

Beginning with the Facebook Core SDK version 4.36, you can perform advanced matching enabling you to send your own 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.

Personally Identifiable Information Data Types

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 Example Code

Set User data while initializing AppEventsLogger. The user data will be hashed and persist between app instances. All following app events will include the hashed user data.

AppEventsLogger logger = AppEventsLogger.newLogger(MainActivity.this);
final Bundle userData = new Bundle();
userData.putString("em", "test@test.com");
userData.putString("ph", "1650123456");
userData.putString("fn", "David");
AppEventsLogger.setUserData(userData);

iOS Example Code

NSDictionary *const userData = @{
        @"em": @"Test@FB.com",
        @"ph": @"1650123456",
        @"fn": @"David"};
[FBSDKAppEvents setUserData:userData];