Facebook Offline Conversions lets you measure your sales in the offline world, resulting through your online Facebook ads. It helps you leverage the offline events data by tracking the in-store purchases, phone orders, bookings, etc.
Getting started
RudderStack supports sending event data to Facebook Offline Conversions via the following connection modes:
Connection Mode | Web | Mobile | Server |
---|---|---|---|
Device mode | - | - | - |
Cloud mode | - | Supported | Supported |
Once you have confirmed that the source platform supports sending events to Facebook Offline Conversions, follow these steps:
- From your RudderStack dashboard, add the source. Then, from the list of destinations, select Facebook Offline Conversions.
- Assign a name to your destination and click Continue.
Connection settings
To successfully configure Facebook Offline Conversions as a destination, you will need to configure the following settings:
- System User Access Token: Enter your system user access token from the Facebook Business account. Refer to the FAQ section for more information on obtaining the access token.
- Map your events with Facebook Standard Events: Use this setting to map the standard Facebook events with custom event names. You can map one or more custom events to a standard Facebook event but not vice-versa.
- Map Facebook Standard Events With Event Set IDs: Use this setting to map the standard Facebook events (specified in the above setting) to Facebook event set ID's. You can map one or more standard Facebook events to event set ID's and vice-versa. Refer to the FAQ section for more information on obtaining the event set ID's.
- Map Categories to Facebook Content Types: Enter the category value and the corresponding Facebook
content_type
which should be mapped to each other. Thiscontent_type
is sent to Facebook every time you send the specified category value via RudderStack. Refer to the Sending customcontent_type
section for more information on sending the customizedcontent_type
to Facebook. - Value Field Identifier: Enter the identifier you want to assign to the
value
field in Facebook's event payload. The default value is set toproperties.value
. - Limited Data Usage: Enable this setting to let RudderStack take the data processing information from the payload and send it to Facebook.
- Enable Hashing: This setting is enabled by default and hash encodes the user data using
SHA256
. Facebook expects the user data to be hash encoded.
Track
You can use the track
call to capture user events along with the properties associated with them.
track
conversions within 62 days of the occurrence of offline conversions.The event name sent in the track
call must be mapped in the Map Facebook Standard Events With Event Set IDs RudderStack dashboard setting otherwise, an error is thrown.
A sample track
call is shown below:
rudderanalytics.track({ userId: 'user@1', event: 'Product Added', properties: { products: [{ id: 1, category: 'Games', brand: 'Hasbro', price: 18.99, quantity: 1, }], order_id: 'cart1234', price: 18.99, currency: "USD" }, traits: { email: 'alex@example.com', phone: '+1-202-555-0146', gender: 'male', firstName: 'Alex', lastName: "Keener", address: { city: 'New Orleans', state: 'Louisiana', postalCode: '90009', country: 'USA' } }, context: { "dataProcessingOptions": [ [ "LDU" ], 1, 1000 ], }});
If your server has access to Facebook's leadId
from their Lead Ads product, you can choose to send it using the integration specific options. The leadId
is mapped via externalId
, as shown:
"externalId": [ { "id": "leadId-value", "type": "LeadId" }, ]
Property mappings
The following table lists the event property mappings between RudderStack and Facebook Offline Conversions:
RudderStack property | Facebook Offline Conversions property | Notes |
---|---|---|
userId traits.userId traits.id context.traits.userId context.traits.id anonymousId Required | extern_id | - |
originalTimestamp timestamp Required | event_time | Unix timestamp. The default value is the current timestamp. |
event Required | event_name | - |
properties.currency Required | currency | If not provided, the default value is set to USD . |
properties.total properties.price properties.value properties.revenue Required | value (currency value) | If not provided, the default value is set to 0 . |
properties.upload_tag | upload_tag | The default value is set to RudderStack . |
properties.item_number | item_number | - |
properties.order_id properties.orderId | order_id | - |
properties | custom_data | - |
properties.products | contents | - |
traits.email context.traits.email properties.email context.externalId.0.id | email | - |
traits.phone context.traits.phone properties.phone | phone | - |
traits.gender context.traits.gender | gen | - |
traits.birthday context.traits.birthday traits.dateOfBirth context.traits.dateOfBirth traits.dateofbirth context.dateofbirth traits.dob context.traits.dob traits.DOB context.traits.DOB | doby | The expected format is DD, MM, YYYY . RudderStack extracts the year, month, and day before sending it to Facebook Offline Conversions. |
traits.firstName traits.firstname traits.first_name context.traits.firstName context.traits.firstname context.traits.first_name | fn | - |
traits.lastName traits.lastname traits.last_name context.traits.lastName context.traits.lastname context.traits.last_name | ln | - |
traits.address.city context.traits.address.city | ct | - |
traits.state context.traits.state | st | - |
traits.zip traits.zipcode traits.zip_code traits.zipCode traits.postalcode traits.postal_code traits.postalCode traits.address.zipcode traits.address.zip_code | zip | - |
traits.country context.traits.country | country | - |
context.device.advertisingId | madid | - |
context.userAgent | client_user_agent | - |
traits.action_source context.traits.action_source properties.action_source | action_source | - |
context.page.url properties.url | event_source_url | - |
context.fbc | fbc | - |
context.fbp | fbp | - |
Note the following important points while sending event data to Facebook Offline Conversions:
- At least one
match_key
is required to send an event successfully. RudderStack uses SHA256 encoding to hash all thematch_keys
that include personally identifiable data in compliance with Facebook's privacy requirements. - If you send a
products
array using theproperties
object, RudderStack sends only theid
,quantity
,brand
,category
, andprice
properties for each product. The reason is that Facebook throws an error on encountering any property apart from these. - If you send an event name as Product List Viewed, the value of
content_type
key is set asproduct_group
otherwise, it is set asproduct
. - RudderStack sends a conversion event as long as it contains a
userId
. However, it is recommended to send as much user data throughcontext.traits
for better attribution results. - You can send either the
firstName
andlastName
separately or just thename
property. RudderStack maps it tofn
andln
on its own.
Sending custom content_type
You can either send the custom content_type
by specifying it in the Map Categories to Facebook Content Types dashboard setting or via the integrations
object, as shown:
"integrations": { "FacebookOfflineConversions": { "contentType": "sending dedicated content type for this particular payload" }}
The priority order of setting the content_type
value is as follows:
content_type
provided in theintegrations
object is given the highest priority.content_type
provided in the RudderStack dashboard is given the second highest priority.- If none of the above is provided, the
content_type
is set toproduct
by default, except in the following cases:
- If Product List Viewed event is sent:
- with
products
array, then thecontent_type
is set toproduct
. - without the
products
array, then thecontent_type
is set toproduct_group
.
- with
- If Product Viewed event is mapped in the RudderStack dashboard, then the
content_type
is set toproduct
. - If Product Viewed event is not mapped in RudderStack dashboard (default mapping is set to View Content event) and is sent:
- with
products
array, then thecontent_type
is set toproduct
. - without the
products
array, then thecontent_type
is set toproduct_group
.
- with
- If any other event is mapped to the Facebook standard event View Content in the RudderStack dashboard and is sent:
- with
products
array, then thecontent_type
is set toproduct
. - without the
products
array, then thecontent_type
is set toproduct_group
.
- with
FAQ
Where can I find the System User Access Token?
- Log in to the Facebook Business account.
- Go to Business Settings > Users > System users.
- Click Generate New Token, select your app from the dropdown, and ads_management permission.
- Click Generate Token as shown:
Where can I find the event set ID in Facebook dashboard?
- Log in to the Facebook Business account.
- Go to Business Settings > Data Sources > Offline event sets and select Open in Events Manager. You can see the event set ID as shown:
Which permissions are required to upload the offline event data?
Refer to the Facebook dcoumentation to know about the detailed permissions required to upload offline event data.
Contact us
For more information on the topics covered on this page, email us or start a conversation in our Slack community.