Advanced Matching

The Facebook pixel relies on cookies to match Facebook Users to their tracked conversions. If your website visitors have cookies disabled, you can use the pixel's advanced matching feature to include visitor data when the pixel loads. We will then use this data to attempt to match any tracked conversions to their respective Facebook Users.

To use advanced matching, format the visitor's data as a JSON object and include it in your pixel's base code fbq('init') function call as a third parameter. For example, if your pixel ID was 283859598862258, you could do this:

fbq('init', '283859598862258', {
  em: '',  // Values will be hashed
  fn: 'john',                // automatically by the pixel
  ln: 'smith'                // using SHA-256

Visitor Data

You can include the following visitor data in your JSON object. We recommend that you include as much data as possible in order to increase the chance that we successfully match your tracked events to specific Facebook Users.

All values will be hashed automatically by the pixel, unless you have implemented the pixel using an <img> tag, in which case you must hash the values on your own.

Customer Information Data Parameters

Data Parameter Description



City in lower case without spaces or punctuation: menlopark



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

Date of Birth


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



Lower case email address of person:

External ID


Any unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs.

First Name


Lower case first name: john



Either f or m, if unknown, leave blank

Last Name


Lower case last name: smith

Phone Number


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



Two letter state code: ca



Five digit zip code: 94035


The pixel uses an HTTPS connection and a dedicated SHA-256 hashing function to hash your JSON object at the browser level before submitting it to our servers. We then use the hashed value to match tracked conversions to their respective Facebook Users. If you have implemented the pixel using an image tag, however, you must hash the JSON object on your own.

All data submitted in your JSON object will be deleted within 48 hours after the matching process ends, regardless of outcome, unless we need to retain any data for troubleshooting or product improvement.

Image Tag

If you have implemented the pixel using an <img> tag, you can still use advanced matching, but you must format and hash your visitor data using a SHA-256 hashing algorithm on your own. For example:

<img height="1" width="1" style="display:none"
  &cd[currency]=USD" /> 

Demo Video

See how to implement advanced matching with the Facebook pixel