Sync Audiences to Facebook Custom Audience Private Beta

Sync audiences created in RudderStack to Facebook Custom Audience.

Setup

  1. Set up an audience in RudderStack using the Audience Builder.
  2. Go to the Syncs tab of the audience page and click Add sync. Then, select Facebook Custom Audience.
  3. Click New destination — you can also select an already-configured destination here.
  4. Specify a unique name to identify this destination in RudderStack.
  5. In the Event delivery account section, click Select to choose from an existing Facebook Ads account from the list. You can also click Add account and authenticate using a Facebook API access token:
Setting
Description
Account NameSpecify a unique Custom Audience account name
Access TokenEnter the access token of your business application set up for accessing the Facebook Marketing API
App SecretThis field is optional. Enter the app secret from the Basic app settings page of your Facebook Developer account
  1. The Ad Account ID field is pre-populated based on the selected Facebook Ads account — select the ID.

Configure sync

This section lists the settings to correctly configure your audience syncs to the Facebook Custom Audience destination.

info

The following two audience types are supported:

Select audience

In this section, you can create a new audience or use an existing one.

  • Create new audience: Use this option to create a new custom audience in Facebook. You can specify the name and description of the new Facebook audience.
info
If you select Create new audience, a new audience is created in Facebook with the same Ad Account ID configured in the connection settings.
  • Use existing audience: Select an existing custom audience. This field is populated based on your connection settings.

Sync mode

RudderStack supports only Mirror mode for this integration.

Map identifiers

In this section, you can map your warehouse columns to specific Custom Audience fields that represent your audience’s identity.

Advanced settings

Setting
Description
Automatically hash PII dataWhen set to Yes, user data is hash-encoded irrespective of whether the data is already hashed or not.

Note: Facebook expects the user data to be hash encoded using SHA256.

See Data hashing section for more information.
Normalize data formattingWhen set to Yes, Facebook automatically cleans and standardizes the audience data, like emails and phone numbers.

See Data normalization section for more information.
Specify where your data originates fromSelect the field that describes the origin of your data — this helps Facebook classify the user list and apply matching and privacy rules.
Specify identifier typeChoose the identifier type that Facebook Ads uses to match users to their profiles.

Sync settings

Two options are available to schedule your audience syncs:

  • Run syncs automatically based on a specified frequency (every 5 minutes, 10 minutes, 15 minutes, 30 minutes, 1 hour, 3 hours, 6 hours, 12 hours, or 24 hours) and a specific time (in UTC).
  • Run syncs manually — trigger a sync from the sync details page. You will need to run the sync each time.

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.

Enable sync

Once the setup is complete, enable the sync.

Manage value-based lookalike audiences

This section describes the steps to map your warehouse data to a new or existing value-based lookalike audience.

New audience

To create a new value-based lookalike audience, map a warehouse column to the Lookalike Value field in the Identifier mappings:

  1. In the Select audience section, select Create new audience and specify the audience name and description.
  2. In the Choose identifier mappings window, map a warehouse column to the Lookalike Value field.
info

Note that:

  • A value-based lookalike audience is not created if you do not include the Lookalike Value in your identifier mappings — a custom audience is created instead.
  • You can update the mapping for the Lookalike Value field after the audience is created.
  1. Set up the other identifier mappings as per your requirement.
  2. Continue with the rest of the setup.

Existing value-based lookalike audience

  1. In the Select audience section, select Use existing audience and select the value-based lookalike audience from the dropdown.
  2. In the Choose identifier mappings window, map a warehouse column to the Lookalike Value field.
info
You can update the mapping for the Lookalike Value field after the audience is created.
  1. Set up the other identifier mappings as per your requirement.
  2. Continue with the rest of the setup.
warning
You cannot change the audience type from a value-based lookalike audience to a regular custom audience (and vice versa) after the audience is created.

Schema fields mapping

The following table details the schema field mappings specified in the dashboard:

Dashboard field nameMarketing API schema field
EMAILEMAIL
PHONEPHONE
GENDERGEN
MADIDMADID
EXTERN_IDEXTERN_ID
DOB YEAR (YYYY)DOBY
DOB MONTH (MM)DOBM
DOB DATE (DD)DOBD
LAST NAMELN
FIRST NAMEFN
FIRST NAME INITIALFI
CITYCT
US STATESST
ZIPZIP
COUNTRYCOUNTRY

Note that the MADID and EXTERN_ID fields are not hashed.

warning
RudderStack modifies the schema names visible in the dashboard for 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.

Data normalization

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

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 enable the Normalize data formatting setting, user data is formatted as prescribed by the Facebook Marketing API.

After normalization, each field is validated before sending it to Facebook.

  • Invalid fields are not sent to Facebook.
  • If all fields in a row are invalid, then the entire row is rejected and marked as failed
info
Data is first normalized, then validated (skipping invalid rows), then hashed before sending to Facebook.

Data hashing

The Automatically hash PII data setting lets you hash your user data before sending it to Facebook. This setting is enabled by default.

  • Configure the setting to Yes if your incoming data is not pre-hashed
  • Configure this setting to No if your data is already hashed
warning

Incorrect configuration of the Automatically hash PII data setting will result in failures.

  • If the Automatically hash PII data setting is configured to Yes and your data is pre-hashed, the event will fail.
  • If the Automatically hash PII data setting is configured to No and your data is not pre-hashed, the event will fail.

Such events are rejected with a clear error message, for example:

Hashing is disabled but the value for field EMAIL appears to be unhashed. Either enable hashing or send pre-hashed data.

You will also see errors in the Events tab for cases that were previously marked as successful but resulted in no matches, helping you identify and fix data quality or configuration issues.

FAQ

Where can I find the Ad Account ID?

Go to your Facebook Ads Manager account where you can find the Ad Account ID in the account’s drop-down menu:

Audience source

You can click on See More Ad Accounts if the required Ad account is not visible.

Where can I find the user Access Token for the application?

warning
To generate the user access token for your application, you must first add it as a system user asset with manage permissions.

Follow these steps to generate a user access token required to use the Facebook Marketing API:

  1. Under the system user, click the Generate New Token button and select the app from the dropdown.
Generate new token
Select app for the token
  1. Choose the Token expiration time.
Token settings
  1. Under Available permissions, select ads_read and ads_management.

Token permissions
Token permissions

  1. Click the Generate Token button and copy the token credentials.

Why am I seeing the error “Failed to update the custom audience. Facebook responded with error code: 2650?

This error is not explicitly documented by Facebook but is a known API-level limitation. Error 2650 typically occurs when attempting to add users to a custom audience that was created using a different data source.

For example:

  • Audience originally created via manual file upload
  • Audience created through another platform or integration
info
Facebook does not allow mixing data source types within the same custom audience.

Questions? We're here to help.

Join the RudderStack Slack community or email us for support