Server-Side API: User Data Parameters

user_data is a set of identifiers Facebook can use for targeted attribution. You must provide at least one of the following user_data keys in your request: (Click on each key to see a full description)

Notes:

  • If you send client_ip_address or client_user_agent, you must send both keys.
  • All of these values for these keys are of type String.

Normalize and Hash

See Custom Audiences from CRM Data for details on how to normalize and hash the data you send. For example, you should trim string data and send it in lower-case. You should also send all data hashed with SHA256 and UTF-8 encoding. We do not accept unhashed data, unless noted below.

Pixel Comparison

You can send most of these user data parameters through the Facebook Pixel as well. For instance, to send external_id through the Pixel, use the following code:

fbq('init', 'PIXEL_ID', {'external_id': 12345});

Read about the other parameters you can pass in the Advanced Matching documentation.


em

Key Type: Email | Hashing Needed

An email address, in lowercase. Example: joe@eg.com

ph

Key Type: Phone | Hashing Needed

A phone number. Include only digits with country code, area code, and number. Example: 16505551212

ge

Key Type: Gender | Hashing Needed

Gender, in lowercase. Either f or m.

db

Key Type: Date of Birth | Hashing Needed

A date of birth given as year, month, and day. Example: 19971226 for December 26, 1997.

ln

Key Type: Last Name | Hashing Needed

A last name in lowercase. Example: smith.

fn

Key Type: First Name | Hashing Needed

A first name in lowercase. Example: joe.

ct

Key Type: City | Hashing Needed

A city in lower-case without spaces or punctuation. Example: menlopark.

st

Key Type: State | Hashing Needed

A two-letter state code in lowercase. Example: ca.

zp

Key Type: Zip | Hashing Needed

If you are in the United States, this is a five-digit zip code. For other locations, follow each country's standards. Example: 94035 (for United States)

country

Key Type: Country | Hashing Needed

A two-letter country code in lowercase. Example: us.

external_id

Key Type: External ID | Hashing is recommended

Any unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs. If External ID is being sent via other channels, it should be sent in the same format via Server-Side API.

client_ip_address

Key Type: Client IP address | Do not hash

The IP address of the browser corresponding to the event.

client_user_agent

Key Type: Client user agent | Do not hash

The user agent for the browser corresponding to the event.

fbc

Key Type: Click ID | Do not hash

The Facebook click ID value stored in the _fbc browser cookie under your domain. See Managing fbc and fbp Parameters for how to get this value, or generate this value from a fbclid query parameter.

fbp

Key Type: Browser ID | Do not hash

The Facebook browser ID value stored in the _fbp browser cookie under your domain. See Managing fbc and fbp Parameters for how to get this value.

subscription_id

Key Type: Subscription ID | Do not hash

The subscription ID for the user in this transaction. This is similar to the order ID for an individual product. Example: anid1234.