Connect Reverse ETL Source to Facebook Custom Audience

Configure a Reverse ETL source with your Facebook Custom Audience destination.

This guide takes you through the steps to connect a Reverse ETL source to the Facebook Custom Audience destination. You can create a new custom audience or use an existing audience to sync the data.

The below steps assume that you have already set up a Reverse ETL source and configured the connection settings for the connected Facebook Custom Audience destination.

success
You can connect multiple Reverse ETL sources to the Facebook Custom Audience destination.

Mapping settings

In the mapping window, you will see the below two options:

  • Create a new Facebook Custom Audience: Use this option to create a new custom audience in Facebook. You can specify the Audience name and Audience description of the new Facebook audience.
  • Use an existing Facebook Custom Audience: Use this option if you have an existing custom audience. Choose the audience (automatically prepopulated by RudderStack based on your specified connection settings) from the dropdown.

Then, specify the below settings:

SettingDescription
Sync modeChoose the sync mode to specify how RudderStack syncs the data to the custom audience.

Note: RudderStack supports only Mirror mode for this destination.
Enable hashingTurn on the toggle to allow RudderStack to hash encode user data irrespective of the schema type chosen in the RudderStack dashboard.

Note: Facebook expects the user data to be hash encoded using SHA256.
Disable formatTurn on the toggle to not format the user data before sending it to the custom audience. Facebook has fixed data formats for all the allowed schema fields.

See the Explicit formatting feature section for more information.
TypeSpecify the type of the custom audience from the dropdown.
Sub-typeSpecify the sub-type of the custom audience from the dropdown.

Choose identifier mappings

Map your warehouse columns to specific Facebook Custom Audience fields:

If you have selected the Create a new Facebook Custom Audience option, RudderStack creates a new audience in Facebook with the same Ad Account ID configured in the connection settings.

Schedule settings

RudderStack determines how and when to run a sync based on the sync schedule you set for your Reverse ETL connection.

Schedule typeDescription
BasicRun syncs at a given time interval and specified time (in UTC).
CRONRun syncs based on a specified CRON expression (in UTC).
ManualRun syncs manually.

Sync observability settings

SettingDescription
Retain sync logsThis setting is toggled on by default and instructs RudderStack to store the sync logs in your warehouse. You can also configure the below settings:

SettingDescription
Sync log retentionSpecify the retention period of the sync logs in your warehouse.

If you set it to 1, then RudderStack deletes any sync log older than a day (in UTC time).
Snapshot table retentionSpecify the number of snapshot tables to retain.
Retry failed recordsThis setting is toggled on by default and causes RudderStack to continually retry sending the failed records.
warning
Storing sync logs and snapshot tables may incur additional warehouse costs.

record event structure

The Facebook Custom Audience destination supports only record events.

A sample record event that RudderStack sends to Facebook is shown:

{
  "action": "insert",
  "channel": "sources",
  "context": {
    "sources": {
      "job_id": "2o9EffQ0mAIrGAgRxcLuwxhiXM0",
      "job_run_id": "cskrt1kme831eq0jrafg",
      "task_run_id": "cskrt1sme831eq0jrag0",
      "version": "v1.57.0-rc.1"
    }
  },
  "fields": {},
  "identifiers": {
    "EMAIL": "alex@example.com"
  },
  "messageId": "997b78eb-d06a-4123-b4d6-d3b87b62c3a9",
  "receivedAt": "2024-11-05T06:43:27.176Z",
  "recordId": "1",
  "request_ip": "10.1.17.46",
  "rudderId": "853ae90f-0351-424b-973e-a615e6487517",
  "type": "record"
}
ParameterDescription
contextUsed for internal metrics for a sync task run.
recordIdOrdering ID that RudderStack adds when delivering the events from the warehouse.
messageIdUUID generated by RudderStack.
rudderIdUUID generated by RudderStack.

Schema fields mapping

The following table details the schema fields mappings specified in the RudderStack dashboard:

Dashboard field nameMarketing API schema field (RudderStack-supported field name)Guidelines
EMAILEMAILTrim any leading or trailing whitespaces and convert all the characters to lower case.
PHONEPHONERemove symbols, letters, and any leading zeroes. The country code is needed as a prefix, if the COUNTRY field is not specified in the dashboard.
GENDERGENUse these values: m or male for male and f or female for female.
MADIDMADIDUse lowercase and keep the hyphens. This information will not be hashed.
EXTERN_IDEXTERN_IDThis information will not be hashed.
DOB YEAR (YYYY)DOBYUse the YYYY format from 1900 to the current year.
DOB MONTH (MM)DOBMUse the MM format from 01 to 12.
DOB DATE (DD)DOBDUse the DD format from 01 to 31.
LAST NAMELNUse a-z only. Lower case only, no punctuation. Use special characters in the UTF-8 format.
FIRST NAMEFNUse a-z only. Lower case only, no punctuation. Use special characters in the UTF-8 format.
FIRST NAME INITIALFIUse a-z only. Lower case only. Use special characters in the UTF-8 format.
CITYCTUse a-z only. Lower case only, with no punctuation, no special characters, and no whitespace.
US STATESSTUse the 2-character ANSI abbreviation code in lower case. Normalize the states outside the US in lowercase, with no punctuation, no special characters, and no white space.
ZIPZIPUse lower case and no white space. For US, use only the first 5 digits. For UK, use the Area/District/Sector format.
COUNTRYCOUNTRYUse lower case, 2-letter ISO 3166-1 alpha-2 country codes.
warning
RudderStack modifies the schema names visible in the dashboard to ensure better readability. However, during the event call, the field names must be exactly the same as the schema names specified by Facebook Marketing API, as mentioned in the table above.

Explicit formatting feature

By default, RudderStack formats the data as prescribed by Facebook before sending it to the destination, as shown in the below table:

Schema field nameExample inputFormatted output (before hashing)
EMAILABC@gmail.comabc@gmail.com
PHONE0@9634689596346895
GENFEMALEf
DOBD202
DOBM101
LN & FNAbc,@abc@
FIMr.mr.
CTHN#hn
ST? AL ?al
ZIP11502 @bc11502@bc
COUNTRYINin

If you turn on the Disable Format toggle in the RudderStack dashboard, RudderStack does not format the user data in the format prescribed by the Facebook Marketing API.

FAQ

Where can I find the Custom Audience ID?

  1. To get your Custom Audience ID, go to the Facebook Ads Manager account. On the left navigation bar, select Audiences and choose the Ad account you have created the custom audience for.
Customer audience ID
  1. Click All Audiences and select the specific custom audience from the list.
  2. Finally, click the History tab. Here, you will find the audience ID under the Item Changed column:
Customer audience ID

Questions? Contact us by email or on Slack