{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["tabs","tab","admonition"]},"redocly_category":"Integrations","type":"markdown"},"seo":{"title":"Facebook Conversion Export From Audience Studio","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"facebook-conversion-export-from-audience-studio","__idx":0},"children":["Facebook Conversion Export From Audience Studio"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This document describes how to use the Facebook Conversion connector in Audience Studio to create activations on Facebook."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure 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 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.facebook.com/docs/marketing-api/conversions-api/offline-events#2--sending-events"},"children":["Sending Offline Events Using the Conversions API"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"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/events\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"creating-the-activation-in-treasure-data","__idx":1},"children":["Creating the Activation in Treasure Data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To send events to Facebook from Treasure Data Audience Studio:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Obtain a Facebook Pixel ID and Access Token and create an authentication for Facebook in the Treasure Console. (Detailed instructions for this step can be found ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/int/facebook-conversions-api-export-integration#create-a-new-connection"},"children":["here"]},".)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create a batch segment in Treasure Console."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Here is an example of a segment that contains offline events."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/segment.34bebc5db0ef2ed5ab7054ba95e00465013d246bec5853ee281c85c8b72c29c1.c13ed41d.png","alt":""},"children":[]}," ","3. Enter the activation Details."," ","The details you need to supply are:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Name"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Authentication for the Facebook connector"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["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."," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/act1.71e1c98c306eac04e73b853a4c9df06c04bbddf75a1550840242df4f0b9b4915.c13ed41d.png","alt":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Provide the output mapping details."," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/act2.9be43aa702a51359baf59b5f8c46020990b0219c76feab5fbe9162bff9aa404c.c13ed41d.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["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:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Optiaon A: Use a custom Query and use custom_fields to define custom_data."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Option B: Select all and use custom_fields to define custom_data."]}]}]}]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"Option A","disable":false},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Custome Query Exmaple"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"SELECT\n   usd_currency as currency,\n   usd_amount as value,\n   ctype as content_type,\n   c1_id as \"contents[0].id\",\n   c1_pr as \"contents[0].item_price\",\n   c1_qt as \"contents[0].quantity\"\nFROM\n table_name;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Custom Fields (for step 3)"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"custom_fields=\ncurrency,\nvalue,\ncontent_type,\ncontents[0].id,\ncontents[0].item_price,\ncontents[0].quantity\n"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"Option B","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select all and use custom_fields to define custom_data."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Query"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"SELECT\n　*\nFROM\n table_name;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Custom Fields (for step 3)"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"custom_fields=\nusd_currency as currency,\nusd_amount as value,\nctype as content_type,\nc1_id as contents[0].id,\nc1_pr as contents[0].item_price,\nc1_qt as contents[0].quantity\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you require more attributes beside id and quantity, add those accordingly."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"usd_currency as currency,\nusd_amount as value,\nc1_id as contents[0].id,\nc1_qt as contents[0].quantity,\nc1_id as contents[1].id,\nc1_qt as contents[1].quantity\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For 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"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":6},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Schedule and run your activation."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"results-on-facebook","__idx":2},"children":["Results on Facebook"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the events appear on the Facebook dataset, they will look something like this:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/result.42a38a07bec73c913808dcd0b06882ea93186c42a088daf0b860793ceb781b88.c13ed41d.png","alt":""},"children":[]}]}]},"headings":[{"value":"Facebook Conversion Export From Audience Studio","id":"facebook-conversion-export-from-audience-studio","depth":1},{"value":"Creating the Activation in Treasure Data","id":"creating-the-activation-in-treasure-data","depth":2},{"value":"Results on Facebook","id":"results-on-facebook","depth":2}],"frontmatter":{"seo":{"title":"Facebook Conversion Export From Audience Studio"}},"lastModified":"2026-06-01T09:09:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/int/facebook-conversion-export-from-audience-studio","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}