Facebook is an online social media and social networking service owned by Meta. This destination leverages Conversions API to help you get improved performance in lead ads by sharing your CRM data about your leads back to Meta to unlock quality lead optimization.
The Facebook Lead Ads destination provides the following key features:
Events structure: our Events reference leverages Facebook events, meaning that your data is properly bridged to the expected fields in an optimized way.
Prebuilt mappings: data mapping for event-based destinations happens automatically, which simplifies user inputs.
Smart mapping: data mapping can be readjusted using your datalayer defined fields.
Integrating your CRM is required and documented following the Plan Your Project Timeline section via Meta documentation: see 1: Connecting Your CRM With Lead Ads and 2: Getting Started With the CRM Integration for detailed information. This destination covers 3: Implementing the CRM Integration section in the project. Before continuing, you may want to inspect Check If Your Business Is a Good Fit section to see if the optimization model can be beneficial to you. Moreover, you need to review Before you begin and Limitations sections for a checklist of what is needed and current constraints.
Settings | Description |
---|---|
[1] See Mapping for more details.
Most properties can be remapped using our "Smart Mapping" feature.
Facebook properties are set starting from the path data.0
.
[*] Mandatory property. [1] See Mapping for more details. [2] If this field is not provided, the current timestamp is used.
Aka Facebook CAPI
Facebook is an online social media and social networking service owned by Meta. This destination allows you to push every kind of event directly to Facebook through API: by sending online and offline conversions to you can increase the reach and accuracy of your campaigns.
You can, for example, not send campaigns related to a specific product to users who already bought it, or you can also send campaigns to users who bought a specific product in cross-sell logic.
Facebook developed an API called 'Facebook Conversions API' https://developers.facebook.com/docs/marketing-api/conversions-api
You need a Facebook Business Manager account https://business.facebook.com/
Then on the menu, click on 'Events Manager':
Here you have to create a new Web Pixel:
Select Conversions API and give a name to your connection:
Now your pixel is created and you will have access to the IDs needed on our connector.
You need to fill the pixel ID on our connector, it is the ID of the pixel you just created on steps above.
You can find this ID when you click on the pixel's name and on the right of the graph activities. You can find it also on the settings tab.
You can now copy and paste this ID on our connector.
Then you need the Access Token
Click on the settings tab.
Scroll until the section 'Conversions API'
Click on the button 'Create Access Token':
If you are not able to click on the button 'Create access token', that mean you don't have enough rights to do it. You should be administrator on your Facebook Business account to create it.
Then you can copy and paste the Access Token on our connector.
Only events with a consent will be sent to Facebook
Only conversions with personal information (email and/or phone number...) will be sent to Facebook
TRUST Commander is our Consent Management Platform. (More information: https://www.commandersact.com/en/solutions/trustcommander/)
On the connector, the consent is managed with the field 'User Consent Category'. You should enter a category ID, the one corresponding to Facebook (advertising) on Trust consent categories.
We should distinguish 3 cases:
Your online events are collected through our Commanders Act event's tag: You have to provide, in the event tags, the list of category ids consented by the user, through the consent_categories
property.
You are pushing your events to us through API or CSV file: a field consent_categories
must be added on the JSON or CSV to precise the consent category IDs of the user. Then inside the connector setting, use the field 'User Consent Category' to enter a category ID, the one corresponding to Facebook (advertising)
You already manage consents on your side and you only send us, from your server,
events that obtained the consent for the category advertising. In this case, do not fill the field ‘User Consent Category’ in the connector.
Using both the pixel and server is recommended per Facebook as it could avoid losing data.
To make it works, you should have the same configuration for both the pixel and server, using same Facebook parameters.
event_id should be the same
On the pixel, event_id
is automatically generated by our Commanders Act Tag and we retrieve the same value for the server on integrations.facebook.event_id
. As a result, these 2 values should be the same.
Event_name
should be the same also.
Fbp
parameter is automatically retrieved to keep the same value between pixel and server.
Deduplication works when the same event is sent first from the browser and then from the server, otherwise it creates a duplicate. Events are pushed in real-time.
On pixel:
eventID: tC.uniqueEventId
is automatically generated.
On server:
integrations.facebook.event_id
automatically retrieves the eventID value coming from the pixel (eventID: tC.uniqueEventId
) for standard events.
The Facebook CAPI Destination will turn the Commanders Act event like...
...into Facebook CAPI events like :
The following mappings are fully automated and do not require any additional configuration by default. You can still customize each as follows.
event_name
Facebook Pixel specifies Standard Events whose semantics correspond to events in the Commanders Act Standard
If the destination receives a Commanders Act Event with event_name
matching the list, it will automatically be sent under the associated Facebook Standard Event name. Otherwise, it will be sent without any transformation
Examples :
If the destinations sees a add_to_cart
event (IN the list), it will send an AddToCart
to Facebook CAPI
If the destinations sees a custom_name
event (NOT IN the list), it will send an custom_name
to Facebook CAPI (no transformation)
Remark: You can customise the event_name using Properties Transformations in Destination settings.
action_source
By default, action_source
will be set to 'website'
(most events relate to online activity)
IF
your event has the property type='offline'
THEN
the Facebook Event will have action_source='physical_store'
ELSE
the Facebook Event will have action_source='website'
Example :
If you need to overwrite this value, you currently can use Properties Transformation to set the integrations.facebook.action_source
.
user_data
Every property can be overridden using integrations.facebook.user_data.<property>
Events can only be used if there is enough information to match a user. Facebook expects at least one user_data
property, but strongly advises sending as many properties as possible.
Here are our conditions to send the events :
at least 1 of those fields: em
, ph
, external_id
, fbp
, fbc
at least 3 of the other fields
Note : external_id, fbp, fbc will allow matching event with other events. But to match a user, one of those events shall contain additional information (em
and ph
are best suited for matching)
custom_data
Facebook specifies rules for standard properties. The rest is completely free.
By default, we fill custom_data
as follows :
We copy all CommandersAct Event properties into custom_data
(except some context fields like source_key
)
Then we map the standard properties according to the table above (can overwrite 1. values)
Finally, we overwrite with integrations.facebook.custom_data.<property>
if exists
custom_data
Best choice would be to use Properties Transformation to modify your event properties which will be copied into custom_data
.
But you can override the final value using integrations.facebook.custom_data.<property>
.
Example :
integrations.facebook.*
deprecationintegrations.facebook.*
usage will be deprecated.
The feature is still working, but it is recommended to use the destination settings instead for maintenance and reliability purpose.
To view quality matching on Facebook interface, go here: Events manager > select the event > View Details > Event Matching > Rating Background
The recommanded way is to use the HTTP Tracking API source to send your offline events from your servers (or any other emmiter).
You just need to send a purchase event with the type
property equals to offline
More details on the automatic mapping here: Mapping action_source
Commanders Act Events | Facebook Events |
---|---|
Commanders Act Properties | Facebook Properties |
---|---|
COMMANDERS ACT EVENTS | FACEBOOK STANDARD EVENT |
---|---|
COMMANDERS ACT STANDARD PROPERTIES | FACEBOOK STANDARD PARAMETERS |
---|---|
COMMANDERS ACT STANDARD PROPERTIES | FACEBOOK STANDARD PARAMETERS |
---|---|
Pixel Id
Required
Your pixel identifier associated with your Conversions API event(s). You can retrieve your pixel identifier by accessing the Events Manager.
Access Token
Required
You can generate an access token by entering the Events Manager, selecting your pixel, and clicking the "Settings" tab. In the "Conversions API" section, you can click the button "Generate access token".
Lead Id
Required
The 15 or 16 digit Facebook generated lead identifier from your downloaded leads. More details are available by following this LINK.
Lead Event Source
Required
Set this to the name of the CRM/tool where the leads are coming from (E.g. "Hubspot", "SAP", "Oracle", "Dynamics", "In-house CRM", etc...).
Mapping
Required
Your mapping between Facebook's events and yours. In Facebook event name
, you can set either a standard event or a custom event name. At least one entry is required. More details are available by following this LINK.
[Any Event]
[1]
[Any Event]
[1]
Facebook event name
event_name
[*][1]
context.event_timestamp
event_time
[*][2]
Lead Id
user_data.lead_id
[*]
Lead Event Source
custom_data.lead_event_source
[*]
begin_checkout
InitiateCheckout
purchase
Purchase
add_to_cart
AddToCart
view_item
ViewContent
view_item_list
ViewContent
search
Search
add_payment_info
AddPaymentInfo
add_to_wishlist
AddToWishlist
generate_lead
Lead
page_view
PageView
sign_up
CompleteRegistration
contact
Contact
customize_product
CustomizeProduct
donate
Donate
find_location
FindLocation
schedule
Schedule
search
Search
start_trial
StartTrial
submit_application
SubmitApplication
subscribe
Subscribe
user.id
(hashed)
user_data.external_id
user.email
user_data.em
(email, hashed)
user.phone
user_data.ph
(phone, hashed)
user.gender
user_data.ge
(gender, hashed)
user.birthdate
user_data.db
(birthdate, hashed)
user.lastname
user_data.ln
(last name, hashed)
user.firstname
user_data.fn
(first name, hashed)
user.city
user_data.ct
(city, hashed)
user.state
user_data.st
(state, hashed)
user.zipcode
user_data.zp
(zip code, hashed)
user.country
user_data.country
(hashed)
context.device.ip
Automatically set if generated from Commanders Act OneTag
user_data.client_ip_address
context.device.user_agent
Automatically set if generated from Commanders Act OneTag
user_data.client_user_agent
The cookie "fbc"
Automatically created by the Facebook Pixel client-side tag.
user_data.fbc
(Click ID)
The cookie "fbp"
Automatically created by the Facebook Pixel client-side tag.
user_data.fbp
(Browser ID)
value
custom_data.value
currency
custom_data.currency
items
custom_data.contents
name
OR first items[i].product.name
found
custom_data.content_name
category
OR first items[i].product.category_N
found (N
∈ [1, 5])
custom_data.content_category
default value : 'product
'
custom_data.content_type
status
custom_data.status
value
custom_data.value
currency
custom_data.currency
items
custom_data.contents
name
OR first items[i].product.name
found
custom_data.content_name
category
OR first items[i].product.category_N
found (N
∈ [1, 5])
custom_data.content_category
default value : 'product
'
custom_data.content_type
status
custom_data.status
Commanders Act provides a GTM template to connect your existing GTM implementation to our serverside endpoint, enabling "Facebook CAPI" in a secured environment.
Add our bridge tag
Update your Facebook tags
First, access GTM and then add our template "Commanders Act | Serverside events bridge" You can follow our dedicated guide:
If you're planning to keep running your existing Facebook pixels while using "Facebook CAPI" through GTM, it's really important that you update them following these guidelines. This will allow to deduplicate and keep consistent measurements of your events.
The process is straightforward as for every event you're sending via pixel tags you just need to add the event identifier - On GTM, open your "Facebook Pixel" tag and expand (14) "More Settings" to locate the "Event ID" and click (15) its icon on the right.
A new window will slide-in. Click on (16)
the plus on the top right.
Click on (17)
the "Variable Configuration".
Click (18)
the "JavaScript Variable".
Rename your (19)
variable as window.tC.uniqueEventId and set the same name in (20)
the "Global Variable Name" then click (21)
the "Save" button.
Back on the tag configuration, expand (22)
"Advanced Settings" and (23)
"Tag Sequencing" to check (24)
the option "Fire a tag before Facebook Pixel fires". In "Set-up Tag", select (25)
"Commanders Act | Serverside events bridge" and save your tag.
Repeat this configuration for each active "Facebook Pixel" in GTM.
See Facebook documentation for more details: Deduplicate Pixel and Server Event
Contact your reference consultant or our Support team in case you need assistance.
The Performance tab can now display Event Match Quality insights, coming from Facebook. It represents the matching quality, referring to the quality of events sent (completeness of data, like events with email, phone, fbp, fbc...). More identifiers are present on events sent, better is the score.
First, select (or login) the Facebook account to which belongs the pixel defined in the Settings step.
Facebook accounts can be managed on Administration / Connector credentials
You can click on a specific event to get more details about the score.
For each event, you can get the details of matching keys and the corresponding volume (%).
This information is also available on Facebook Business Manager interface (Events Manager).
Facebook is an online social media and social networking service owned by Meta. An API based Facebook Connector can be set up with the following procedure. The connector will send users data of all the users belonging to a given segment. The audience sent can contain both FB subscribers and non subscribers.
More information you send to Facebook, better is the matching with Facebook. You can choose to send email, phone number or any other information to increase the matching with Facebook.
If users don't have enough information, we will reject them (example: if a user only have a zip code, Facebook will not be able to match this user with only this information).
It takes up to 24 hours for Facebook to match users.
You need 2 information for the Facebook connector:
Ad Account ID
Access Token
You have to go on Facebook Business https://business.facebook.com/ and login to your account.
Then you have to go to ‘Ad Account settings’:
And you will find the Ad Account ID:
Copy and paste it on our Facebook connector.
For this part, you have to go to Facebook Developers https://developers.facebook.com/ and create or login to your account (you need to have a dedicated account for Facebook Developer).
Create a new app
Add the product ‘Marketing API’.
Go on ‘Settings’ and ‘Advanced’ section
Link your app to your Business Manager account and add your Ad Account ID in the ‘Authorized Ad Account ID’ section:
Then click on 'App Review' and 'Permissions and features'. Find the 'Ads Management Standard Access' component and, if you don't already have it, submit a request:
https://developers.facebook.com/docs/marketing-api/access#standard
Wait for the validation of your request.
Now you have an App linked to your Facebook Business Manager Account (https://business.facebook.com/). Please check this page to be sure that the App is well associated with the Business account:
You should see in your Facebook Business account the new App you created.
You can choose here to generate a token without any expiration date (1st method, recommended) or with an expiration date (60 days - 2nd method, not recommended).
You have to create a system user on your Facebook Business Account (https://business.facebook.com/).
This system user should have admin rights for the ad account and for the app you created.
When it is done, you can Generate New Token:
Select the App you have created before and select the right permission:
Then copy and paste the generated token on our connector:
On the Facebook developers, on your App you created, click on ‘Marketing API’ and ‘Tools’.
On ‘Get Access Token’, tick ‘ads_management’ and click on ‘Get Token’.
You can now copy and paste this token on our Facebook connector.
Be careful: Each time you click on Get Token it will generate a new one that you have to use (the previous one will be not valid anymore)
Before to save the connector, be sure you have accepted Facebook general conditions for custom audiences.
Go on this link and replace the AD_ACCOUNT_ID per your own Ad Account ID:
https://www.facebook.com/ads/manage/customaudiences/tos/?act=AD_ACCOUNT_ID
Be sure you have the admin rights for your Facebook Business account
Save the connector and users who will enter the segment will be pushed to Facebook new custom audience.
Then on Facebook, click on Audiences.
A new custom audience will be created.
The name of the new audience will start with CA_{name}