Set up Facebook Pixel as a destination in RudderStack.
8 minute read
This guide will help you set up Facebook Pixel as a destination in the RudderStack dashboard. It also lists the configuration settings required to correctly send data from the supported sources to Facebook Pixel.
In the web device mode integration, that is, using JavaScript SDK as a source, RudderStack loads the Facebook Pixel native SDK from the https://connect.facebook.net/ domain.
Based on your website’s content security policy, you will need to allowlist this domain to load the Facebook Pixel SDK successfully.
Go to the Overview tab of your source and select Add Destination > Create new destination.
Select Facebook Pixel from the list of destinations. Then, click Continue.
Connection settings
Setting
Description
Name
Assign a name to uniquely identify the destination in RudderStack.
Pixel ID
Enter your Facebook Pixel ID — this is required for sending events in both cloud and device modes.
See the FAQ section below for more information on obtaining your Facebook Pixel ID.
Business Access Token
Specify your Facebook business access token — it is required to send events only in cloud mode.
See the FAQ section below for more information on obtaining this token.
Configuration settings
Configure the settings in the below sections to receive your data correctly in Facebook Pixel.
Event settings
Setting
Description
Enable Standard Event (PageView) for all Page and Screen Calls
If toggled on, RudderStack sets pageview as a standard event for all page and screen calls.
Value Field Identifier
Set this field to either properties.price or properties.value from the dropdown — RudderStack maps it to Facebook’s value field. You can use this setting for the Product Viewed or Product Added events.
Enable Advanced Matching
Toggle on this setting to update user information in Facebook Pixel device mode.
RudderStack maps some events to the Facebook custom events by default. You can use this option to override the default mappings and map your events to specific Facebook custom events.
PII properties settings
The following settings help you control how RudderStack handles personally identifiable information (PII) before sending events to Facebook Pixel, helping you comply with Facebook’s data policies and privacy requirements.
Setting
Description
Denylist PII Properties
Specify the PII properties to exclude completely or hash before sending events to Facebook. You can configure each property individually to either exclude or hash it.
Hash Denylist PII Property
Toggle on this setting to hash-encrypt the PII properties mentioned in the Denylist PII Properties field in SHA-256 format before sending them to Facebook.
If this setting is toggled off, the PII property specified in the Denylist PII Properties field is excluded from the events sent to Facebook.
Input PII properties you want to allowlist
Specify PII properties that RudderStack should include in events sent to Facebook.
Note the following:
This setting is applicable only for the default denylisted PII properties (listed below).
Configure the consent management settings for the specified source by choosing the Consent management provider from the dropdown and entering the relevant consent category IDs.
With this setting, you can send specific events to a legacy conversion Pixel by specifying the event-Pixel ID mapping.
Enable Automatic Configuration
Toggled on by default, this setting sends button click and page metadata from your website to improve your ads delivery and measurement and automate your Pixel setup.
If you toggle on the Use Updated Mappingsdashboard setting, RudderStack takes the following traits:
{firstName:"Alex",lastName:"Keener",email:"alex@example.com",phone:"12345678910",gender:"Male",birthday:"01012001",city:"New Orleans",country:"USA",zip:"90009",// You can also send postalCode instead
state:"Louisiana",foo:"bar",}
It then sends the above traits to Facebook Pixel in the following format:
If you toggle on the Limited Data Usagedashboard setting, RudderStack takes the data processing information from the event payload and sends it to Facebook.
Note that the data in the RudderStack event payload should be as shown:
You can send the value of fbc parameter via context.fbc as shown in the above payload. If not provided, RudderStack autogenerates it using the following values:
Fetches fbclid from context.page.url
Uses originalTimestamp as the creation time
Sets subdomainIndex to 1
Sets version to fb
The context.dataProcessingOptions will be mapped to data_processing_options in Facebook as is mentioned in the Facebook developer docs.
FAQ
Where can I find the Pixel ID?
To get your Pixel ID, go to your Facebook Ads Manager account. On the left navigation bar, select Business Tools, and click Events Manager under Manage Business.
In the Data Sources, you should be able to see your Pixel ID underneath your site name.
Where can I find the Business Access Token?
In order to use the Facebook Conversions API, you need to generate an access token. We recommend using the Facebook Events Manager to do so, by following these steps:
Choose the relevant Facebook Pixel and click the Settings tab.
In the Conversions API section, click Generate access token under the Set up manually section:
For more information on how to use this access token or to generate your access token via your own app, refer to the Facebook documentation.
Can I hash my user data before sending it to RudderStack?
Yes. Facebook Pixel requires all user data, data coming from context.traits, to be hashed. This includes email, phone, birthday, address, etc. By default, RudderStack will automatically hash all of the necessary properties for you. However, if you would like to hash these traits before sending to RudderStack then you need to add this code to the event.
The integrations object with these key-values will tell RudderStack not to hash the traits in context.traits because they are already hashed. Otherwise, RudderStack will hash your data again and Facebook will not be able to match the traits. Please keep in mind that Facebook will not accept un-hashed data.
I can see my events being sent in the RudderStack dashboard but are not visible in the Facebook Pixel dashboard. What could be the reason?
It may take up to 24 hours for your events to reflect in the Facebook Pixel dashboard. You can also verify if your events are flowing correctly by enabling the Use as Test Destination setting in the RudderStack dashboard. It reflects the events in the Facebook Pixel dashboard in real time.
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.