This document describes how to use the Facebook Conversion connector in Audience Studio to create activations on Facebook.
TD Console starts the activation on Facebook by sending an API call to Facebook with a request payload that contains information like telephone number, email address, item list, currency, etc. Here is an example of the API call. For additional information see the Meta documentation Sending Offline Events Using the Conversions API.
curl -X POST -F 'data=[{"event_name": "Purchase", "event_time": 1674000041, "user_data": {"em":["309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd"], "ph": ["254aa248acb47dd654ca3ea53f48c2c26d641d23d7e2e93a1ec56258df7674c4","6f4fcb9deaeadc8f9746ae76d97ce1239e98b404efe5da3ee0b7149740f89ad6"]}, "custom_data": {"currency": "usd","value": 123.45,"contents": [{"id": "product123","quantity": 1}]},"action_source": "physical_store"}]' -F 'access_token=ACCESS_TOKEN' https://graph.facebook.com/v15.0/DATASET_ID/eventsTo send events to Facebook from Treasure Data Audience Studio:
- Obtain a Facebook Pixel ID and Access Token and create an authentication for Facebook in the TD Console. (Detailed instructions for this step can be found here.)
- Create a batch segment in TD Console.
Here is an example of a segment that contains offline events.
3. Enter the activation Details. The details you need to supply are:
- Name
- Authentication for the Facebook connector
- Custom Fields entries—custom field entries are required in order to crate the request payload that will be sent to Facebook in JSON format. Step 5 shows how to set up custom fields.

- Provide the output mapping details.

- Set up the Custom Fields. The Custom Fields needs to be set up so to align with the output column mapping. There are two options for accomplishing this:
- Optiaon A: Use a custom Query and use custom_fields to define custom_data.
- Option B: Select all and use custom_fields to define custom_data.
- Custome Query Exmaple
SELECT
usd_currency as currency,
usd_amount as value,
ctype as content_type,
c1_id as "contents[0].id",
c1_pr as "contents[0].item_price",
c1_qt as "contents[0].quantity"
FROM
table_name;- Custom Fields (for step 3)
custom_fields=
currency,
value,
content_type,
contents[0].id,
contents[0].item_price,
contents[0].quantityFor the list size, you will need to configure the index to be "greater than or equal to" the list size. For example, if the largest item list has 10 items, configure your list until contents[9].attribute
- Schedule and run your activation.
When the events appear on the Facebook dataset, they will look something like this:
