Facebook Pixel Setup Guide (Legacy)
The Facebook Pixel tag combines the functionality of the Facebook Custom Audiences Pixel and the Conversion Tracking Pixel.
This is the legacy version of the tag and will soon be deprecated and replaced with the Facebook Pixel tag
Prerequisites
- Facebook Ads Account
- Upgraded Facebook Pixel (or legacy Custom Audiences pixel)
- Conversion Pixel (legacy)
Tag Configuration
First, go to the Tealium tag marketplace and add the Facebook Pixel tag to your profile. For more information, see Manage Tags.
The best practice is to configure a single tag instance per pixel ID for standard PageView and event tracking.
After adding the tag, configure the settings described in the following table:
Setting | Description |
---|---|
Title |
|
Facebook Pixel ID |
|
Conversion Pixel ID |
|
Allow Default Page View |
disablePushState . When you set this flag to true , it will stop sending PageView events on history state change. |
Default Event to Send |
|
Advanced Matching |
|
Auto calculate number of items |
|
Enable trackSingle |
|
Enable trackCustom |
|
Load Rules
Load rules determine when and where to load an instance of this tag on your site.
Recommended Load Rule:
- For tracking standard PageView and events, use the default All Pages rule
- For tracking legacy Conversion Pixel, apply custom rule conditions to load the tag on specific conversion pages.
Data Mappings
Mapping is the process of sending data from a Data Layer Variable to the corresponding destination variable of the vendor tag.The destination variables for the Facebook Pixel tag are built into the Data Mapping tab. For instructions on how to map a variable to a tag destination, see Data Mappings.The following sections describe available categories:
Standard
Use these mappings to override the tag configuration settings. This can be useful if you want to set values dynamically based on your data layer.
Destination Name | Destination Variable | Description |
---|---|---|
Facebook Pixel ID | cust_pixel |
Numeric identifier(s) of the Facebook Pixel |
Conversion Pixel ID | conv_pixel |
Numeric identifier of the legacy conversion pixel |
Allow Init Page View [true /false ] |
page_view |
‘init’ track call |
List of Events to fire | evt_list |
Events listed either as comma-separated values or an array in your variable |
Enable trackSingle [true /false] |
track_single |
|
Enable trackCustom [ true /false ] |
track_custom |
|
Advanced Matching
With this additional data, you can report and optimize your ads for more conversions and build larger re-marketing audiences. You can pass the customer identifiers that you collect from your website during the check-out, account sign-in or registration process as parameters in the pixel.
In Advanced Matching, the case of the term entered is normalized unless the item to be matched is already recognized.
Destination Name | Destination Variable | Description |
---|---|---|
em |
||
First Name | fn |
First name |
Last Name | ln |
Last name |
Phone Number | ph |
Numeric value of phone number |
Gender | ge |
f or m |
Date of Birth | db |
[ yyyymmdd ] |
City | ct |
City |
State | st |
2-letter code |
Zip | zp |
Zipcode |
E-Commerce
Since the Facebook Pixel tag is e-commerce enabled, it will automatically use the default E-Commerce Extension mappings. Manually mapping in this category is not needed unless you want to override any extension mappings or your desired e-commerce variable is not offered in the extension.
Destination Name | Destination Variable | Description | E-Commerce Extension Variable |
---|---|---|---|
Order ID | order_id |
Unique identifier assigned to the final order | _corder |
Sub Total | sub_total |
Sub total amount of the final order | _csubtotal |
Currency | order_currency |
Currency used in the payment | _ccurrency |
List of Product IDs | product_id |
Unique identifier of each product in the product array | _cprod |
List of Product Names | product_name |
Name of each product in the product array | _cprodname |
List of Categories | product_category |
Category of each product in the product array | _ccat |
List of Prices | product_unit_price |
Unit price of each product in the product array | _cprice |
Limited Data Use
Variable | Description |
---|---|
lmt_data.use_ldu (Use LDU) |
|
lmt_data.ldu_types.geolocate (LDU should Geolocate) |
|
lmt_data.ldu_types.california (LDU is California) |
|
Events
Map to these destinations for triggering specific events on a page. Events are used for tracking conversions and building targetable audiences for your Facebook ads.
The Purchase event is automatically triggered when an Order ID value is available, either through the E-Commerce extension or a direct data mapping.
Use the following steps to map an event:
- In the Trigger field, enter the value of the variable you are mapping to the destination that corresponds to the event selected.
For example, if you want to trigger the Purchase event whenevent_name="order"
is in your UDO, you would enterorder
(assuming you are currently mapping the variableevent_name
). - In the Event field, select the desired event from the drop-down list (for example, Purchase).
- Click + Add.
Custom Events
For custom events, select Custom and enter a name for the custom event.
In this following example the custom event “InboundLead” will be triggered when the variable event_name
equals inbound_lead_event
.
To edit a custom event, single click on the destination input field to edit the event name directly. The values are entered in the form: {VARIABLE_VALUE}:{DESTINATION_EVENT}
.
- The left-side of the colon is the variable value that will trigger the event, such as
inbound_lead_event
- The right-side of the colon is the custom event name, such as
InboundLead
.
Custom Event Data
Map to these destinations if you want to pass a custom parameter with a custom Event that you mapped in the Events tab.
Use the following steps to map a Custom Event Data variable:
- In the Event Name field, enter the name of the custom event exactly as specified in the Events tab.
- In the Parameter field, enter the name of the parameter you want to send.
- Click + Add.
Full List of Standard Events
Destination Event | Event Description |
---|---|
AddPaymentInfo | Visitor adds payment details during the checkout process |
AddToCart | Visitor adds an item to the cart |
AddToWishlist | Visitor adds an item to the wishlist |
CompleteRegistration |
|
Contact | When a person initiates contact with your business via telephone, SMS, email, chat, or other method. |
Conversion | For legacy Conversion Pixel only; requires the Conversion Pixel ID to be set |
Custom |
|
CustomizeProduct | When a person customizes a product. |
InitiateCheckout |
|
Lead |
|
PageView | Visitor views any page on your site |
Purchase | Visitor successfully completes the last step in the checkout process Note: This event is required for tracking conversions; make sure to map it in the Events Tab |
Schedule | When a person books an appointment to visit one of your locations. |
Search | Visitor performs a search action |
StartTrial | When a person starts a free trial of a product or service you offer. |
SubmitApplication | When a person applies for a product, service, or program you offer. |
Subscribe | When a person applies to start a paid subscription for a product or service you offer. |
ViewContent | Visitor views a specific page, indicating their browsing intent |
Parameters
Map to these destinations if you want to pass additional data with the event(s) that you mapped earlier.
Parameters are only used with pre-defined events. See the Custom Event Data section to learn how to pass a parameter with a custom event.
Use the following steps to pass a parameter with a predefined event:
- In the Event field, select a Facebook event from the drop-down list.
- In the Parameter field, select a Facebook parameter from the drop-down list. For a Custom parameter, enter a name to identify the parameter.
- Click + Add.
Full List of Predefined Parameters
Destination Parameter | Description |
---|---|
Value | Value associated with the event |
Currency | Currency associated with the Value parameter |
Content Name | Name of the product or page |
Content Type | Type of the product or page associated with the event |
Content IDs | Any identifier(s) associated with the event |
Content Category | Category of the product or page |
Number of Items | Number of items at checkout |
Search String | Keyword/term used in the search action |
Order ID | Unique identifier of the final order |
Status | Status of the CompleteRegistration event |
Custom | Custom parameter to be passed with a predefined Event |
Hotel Parameters
Map to the destinations listed in the following table to send hotel-related search and hotel booking details with the event(s) you mapped earlier.
Full List of Hotel Parameters
Parameter | Description |
---|---|
Content Type |
hotel . |
Content IDs |
|
Destination |
|
Check-in Date |
|
Check-out Date |
|
Value |
|
Currency |
|
Optional Hotel Parameters
Parameter | Description |
---|---|
City |
|
Region |
|
Country |
|
Number of Adults |
|
Number of children |
|
Suggested Hotels |
|
User Score |
|
Hotel Score |
|
Purchase Currency |
|
Optional Hotel Parameters for Search Events Only
Parameter | Description |
---|---|
Preferred Star Ratings |
|
Preferred Price Range |
|
Preferred Neighborhoods |
|
Journey Parameters
Map to the destinations listed in the following table to send visitor’s travel details (flight or route journey) with the event(s) you mapped earlier.
Full List of Journey Parameters
Parameter | Description |
---|---|
Content Type |
flight for flight journeys and route for non-flight journeys. |
Origin |
|
Destination |
|
Departing Departure Date |
|
Returning Departure Date |
|
Value |
|
Currency |
|
Required Flight Parameters
The following parameters are required when the content type
value equals flight
:
Parameter | Description |
---|---|
Origin Airport |
|
Destination Airport |
|
Optional Journey Parameters
Parameter | Description |
---|---|
Origin City |
|
Origin Region |
|
Origin Country |
|
Destination City |
|
Destination Region |
|
Destination Country |
|
Departing Arrival Date |
|
Returning Arrival Date |
|
Number of Adults |
|
Number of children |
|
Number of Infants |
|
Travel Class |
|
User Score |
|
Purchase Value |
|
Purchase Currency |
|
Optional Journey Parameters for Search Events Only
Parameter | Description |
---|---|
Preferred Number of Stops |
|
Use Cases
This section provides use cases that represent real-life scenarios.
Use Case: Tracking PageView and Standard/Custom Events
Set the PageView event to be fired automatically on all pages and trigger all non-conversion via data mappings.
Use the following steps to set up this use case for your environment:
-
Configure the following settings:
- Pixel ID:
FB_PIXEL_ID
- Allow Default Page view:
True
- Default Event to Send:
None
- Pixel ID:
-
Load the tag on all pages (default rule).
-
Map the variable
event_name
to the non-conversion event(s) of choice.
Use Case: Tracking PageView and Conversion Event (Deprecated)
Triggering a conversion event requires the Conversion Pixel ID. You may do this in the same tag instance you are using for tracking PageView and non-conversion events.
Use the following steps to set up this use case for your environment:
- Configure the following settings:
- Pixel ID:
FB_PIXEL_ID
- Conversion Pixel ID:
CONVERSION_PIXEL_ID
- Allow Default Page view:
True
- Default Event to Send:
None
- Pixel ID:
- Load the tag on all pages (default rule).
- Map the variable
event_name
to the conversion event(s) of choice.
Use Case: Tracking Legacy Conversion Pixel Only (Deprecated)
The Conversion Pixel needs to be tracked in a separate tag instance. In this tag instance, leave the Pixel ID blank and disable automatic pageview tracking. Because you are not tracking specific events, no data mappings are required.
Use the following steps to set up this use case for your environment:
-
Configure the following settings:
- Conversion Pixel ID:
CONVERSION_PIXEL_ID
- Allow Default Page view:
False
- Default Event to Send:
Conversion
- Conversion Pixel ID:
-
Apply custom load rules to load this tag on specific conversion pages.
Use Case: Multiple Pixels on A Single Page
The following use cases represent scenarios that can be used for multiple pixels on a single page:
-
Shared Event Tracking
- If you want multiple Facebook Pixels to share pageview and event tracking, you can add a comma-separated list of those pixel IDs to the Facebook Pixel ID field in the tag configuration settings.
- Having several Facebook Pixels with their own pixel IDs may share event tracking with other Facebook Pixels on the page if their Enable trackSingle setting is
false
, although this may result in inconsistent tracking behavior and is not recommended.
-
Individual Event Tracking
- If you are loading more than one Facebook Pixel on a single page, and you wish to keep the tracking events from being recorded for all of the pixels on that page, then make sure the Enable trackSingle setting is
true
. - This setting will fire event tracking only for the pixel IDs added for that tag.
- If your Facebook Pixel in Tealium iQ was added before March of 2018, you may not be able to take advantage of the trackSingle feature.
- In this case, update your Facebook tag template to the latest version. Note that the trackSingle setting is set to
true
as default. - You must map to
track_single
and set the value tofalse
to override and disable this feature.
- In this case, update your Facebook tag template to the latest version. Note that the trackSingle setting is set to
- If you are loading more than one Facebook Pixel on a single page, and you wish to keep the tracking events from being recorded for all of the pixels on that page, then make sure the Enable trackSingle setting is
-
Versions that predate March 2018
- If you added your tag after March of 2018, refer to the use cases above when setting up multiple Facebook pixels
- Older versions of the Facebook Pixel were not designed to be loaded more than once on a single page.
- The Facebook JavaScript library initializes a single instance of the
fbq
object, which is used for all tracking that occurs on the page (thus reusing the same pixel ID). - If you require more than one Facebook pixel, each with a different pixel ID, to be fired on a single page, and you are unable to update the tag template, then we recommend implementing the
<noscript>
version of the pixel using the Tealium Generic tag.
Example Scenario
Example of Facebook Pixel <noscript>
code:
`<noscript><br>
<img height="1" width="1" style="display:none"<br>
src="https://www.facebook.com/tr?id={{FACEBOOK_PIXEL_ID}}&ev=PageView&noscript=1"<br>
/><br>
</noscript>`
In this scenario, the URL of the hidden image pixel can be configured as follows:
-
Add the Tealium Generic tag.
-
Set the Title to
Facebook Pixel (custom)
. -
Set the Base URL to
https://www.facebook.com/tr
-
Set the Query String to
id={{FACEBOOK_PIXEL_ID}}&ev=PageView&noscript=1"
.
-
Set the desired load rule and data mappings.
-
Click Apply.
Facebook Dynamic Ads for Tealium iQ
For additional information about how to set up Facebook Dynamic Ads in Tealium iQ, see the TLC article How to Set up Facebook Dynamic Ads in Tealium iQ.
Vendor Documentation
See the following vendor documentation for more information:
This page was last updated: July 22, 2020