Sync Users to Facebook Audiences

Census lets you sync Data Warehouse records to Facebook Custom Audiences. Custom Audiences can be used to target Facebook Advertising campaigns more effectively, and using Census together enables your campaigns to react instantly when new users become potential targets to or exclusions from your campaigns.

This article will guide you through creating a sync to a Facebook Custom Audience.

Collect the Facebook Audience ID

Visit the Audiences section of Facebook's Ads Manager. If you'd like to use a new Facebook Audience with Census, go ahead and create it now. Make a note of the ID (name will work too) of the audience you want to sync to from Census. 

Create a SQL Model from your source data

The results of the View, Table, or Census Model should contain a row per user. Each row will have three or more columns:

  1. A unique identifier for the user, Facebook calls this the External ID. This is usually a unique ID from your application database, but could be email as well if that also uniquely identifies each row. 
  2. A column indicating what Facebook Audience the user should be synced to (can be the audience name or audience ID).
  3. Any other identifying fields that Facebook can use to match your audience. Facebook requires these fields to be formatted in a certain way. For example, email must be lower-case. You can read more about each of the formatting requirements in the Facebook Documentation.

Example Facebook Audience Model:

    LOWER(email_address) AS email, 
    'active users audience' AS fb_audience
FROM user_activity_table;

Create a sync

Now that your data is prepared and in the correct format, we're ready to start syncing users to Facebook. 

1. Select your model from above as a data source and Facebook Audiences as a destination.

2. Choose the appropriate sync behavior

Update or Create will add or update users to the audience, but will never remove users. Mirror will also remove users that have disappeared from the source. Note: If you're reusing an existing Facebook Audience, Census will not remove any users already added to that audience through other means. Census only removes users that it created initially.

3. Select an external identifier to match rows uniquely in Facebook

This should be the user id or other external ID you selected when you created the model.

4. Associate users with the Audience

Let Census know which column should be used to assign users to their audience. Select the Audience's ID or Name to correspond to the type of identifier you're providing with your model.

5. Map the remaining identifying fields

You can then map any user identifying fields that are present in your source data (e.g. phone number, email, first name, last name, etc).