Tracking Chef
  • Guides
    • Google Ads
    • Google Analytics
    • Google Tag Manager
    • Google Data Studio
    • Facebook
    • LinkedIn Ads
    • Hubspot
    • Segment
    • Quora Ads
    • Reddit Ads
  • Blog
  • GTM Playground
  • Swag
  • About
  • Guides
    • Google Ads
    • Google Analytics
    • Google Tag Manager
    • Google Data Studio
    • Facebook
    • LinkedIn Ads
    • Hubspot
    • Segment
    • Quora Ads
    • Reddit Ads
  • Blog
  • GTM Playground
  • Swag
  • About
Tracking Chef
  • Guides
    • Google Ads
    • Google Analytics
    • Google Tag Manager
    • Google Data Studio
    • Facebook
    • LinkedIn Ads
    • Hubspot
    • Segment
    • Quora Ads
    • Reddit Ads
  • Blog
  • GTM Playground
  • Swag
  • About
  • Guides
    • Google Ads
    • Google Analytics
    • Google Tag Manager
    • Google Data Studio
    • Facebook
    • LinkedIn Ads
    • Hubspot
    • Segment
    • Quora Ads
    • Reddit Ads
  • Blog
  • GTM Playground
  • Swag
  • About
Facebook Advanced Matching for Web
Home » Facebook
August 11, 2022 Elad Levy

As discussed in a previous post about Facebook’s Event Matching, there are various ways that the Facebook pixel (client and server side) is able to match a certain event with a user.

These methods are split into two – deterministic and probabilistic. For the deterministic methods, we need explicit identification of the user. One way that the Facebook pixel is able to achieve that is, well, by collecting user information that the user provides on the website, i.e. on forms.

Facebook offers two methods to collect this data – manual or automated.

User Data Parameters

There are multiple user parameters that can be sent to Facebook. These fields include:

  • Email
  • Phone number
  • First name
  • Last name
  • ZIP Code
  • City
  • State
  • Country
  • Date of Birth
  • Gender

As you can see, not all of these can provide accurate identification of a user. For example, a pixel sending over to Facebook user parameters of “Elad Levy from Modiin” will probably match half a dozen users or more. For optimal matching, a unique identifier such as an email or phone number is recommended.

Manually sending user data

Hardcoded pixel

If you have the Facebook pixel installed hardcoded on your site follow these instructions.

The basic Facebook pixel load you have should look similar to this:

<script>
  !function(f,b,e,v,n,t,s)
  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
  n.callMethod.apply(n,arguments):n.queue.push(arguments)};
  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
  n.queue=[];t=b.createElement(e);t.async=!0;
  t.src=v;s=b.getElementsByTagName(e)[0];
  s.parentNode.insertBefore(t,s)}(window, document,'script',
  'https://connect.facebook.net/en_US/fbevents.js');
  fbq('init', '1234567890');
  fbq('track', 'PageView');
</script>

(I’m intentionally ignoring the <noscript> tag and you should too)

The above script initializes the specific pixel ID on your site and then triggers a PageView event.

If the user on your site is already identified (i.e. logged in), you can update the init function in the script in this way:

fbq('init', '283859598862258', {
  em: '[email protected]',
  fn: 'Jon',    
  ln: 'snow'      
});

Note that email values will be hashed automatically by the pixel using SHA-256

Any event following this init function will carry the user data.

If the user identification happened after the pixel has been initialized, you can trigger another init call and subsequent events will carry the user data parameters. Alternatively, you can send these parameters with a custom event, such as “Sign In”:

fbq('trackCustom', 'Sign In', {
  em: '[email protected]',
  fn: 'Jon',    
  ln: 'snow'      
});

Google Tag Manager

If you installed the Facebook pixel using Google Tag Manager (GTM), I hope you’ve used the great custom template created by Simo Ahava (now managed by the Facebook team). I explain why it’s better than using a Custom HTML tag in this post. If you’re sticking to Custom HTML, just follow the instructions for the manual implementation above.

The setup is pretty straightforward in GTM.

In your Facebook Pixel tag, tick the “Enable Advanced Matching” checkbox. This will open up a new section named “Customer Information Data Parameters”.

Under the new section, you can select the available parameters (e.g. Email, First Name etc.) and match them with the relevant variable holding that data.

This too can be done on the user identification (i.e. the signup or log-in event) using a custom event.

Automatically sending user data

If you don’t want (or can’t) alter your pixel implementation, you can also opt-in for Facebook to collect the data automatically from website forms.

My contact form

While I usually advocate for sending data explicitly (for increased accuracy) this scraping method is usually good enough for increasing Event Match Quality with minimal effort.

  1. In your Business Manager, navigate to Events Manager
  2. Click the Data sources icon on the side menu
  3. Select the relevant Pixel
  4. Select the Settings tab
  5. Below the Automatic Advanced Matching section, click the toggle ON.
  6. Select Show Options.
  7. Toggle ON the parameters you want to share from your website. For optimal matching, select Email and Phone Number
Setting up Automatic Advance Matching in Facebook

Once setup is complete, it may take up to 48 hours before you see results in the Events Manager.

About the Author

Elad Levy View all posts by Elad Levy

Experienced Web Analyst, working for almost a decade now with various web analytics tools.
Also a husband, father of three rascals, and the co-founder of Fixel.

« Previous
Next »
Leave a Reply

Click here to cancel reply.

Contents hide
User Data Parameters
Manually sending user data
Automatically sending user data
Made with ❤️ by Elad Levy
Disclaimer: Some of the links shared on this site are affiliate links, so if you choose to make a purchase, I’ll earn a small commission. Please note, I only recommend tools I’ve used and have found useful, the commission is not a driving factor