Facebook Custom Audiences Integration

Prev Next

To use Facebook Custom Audiences with customers, you must first integrate the user object, which is required to collect and process users’ email addresses, phone numbers, and GDPR opt-in information.

The email addresses and phone numbers passed to Insider via user object for Facebook Ads Integration are one-way encrypted and are not disclosed to Facebook.

The following describes how to integrate user objects for Facebook Custom Audiences using the Insider Object.

Sample code for Facebook Custom Audiences user object

window.insider_object = {
   "user":{
      "gdpr_optin":true,
      "email":"jdoe@mailservice.com",
      "phone_number": "+120394879878"
   }
}

Namespace

The code of the object is as follows:

window.insider_object.*

The code for the user object for Facebook Ads must be added under the code for the Insider Object.

User object for Facebook Custom Audiences: Properties, definitions, and code

The user object includes the user properties. It can be implemented in all cases, including when the user is not logged in. Only the available properties will be filled in when the user is not logged in; keys without values will not be added to the object.

Key

Property

Type

Definition

gdpr_optin*

GDPR Opt-in

Boolean

User's permission for any Insider campaign, data collection and processing.
False = user will not see any Insider campaign or receive messages from any channel;
True or empty = Insider is able to interact with the user through personalization campaigns.

email*

Email Address

String

User's email address

phone_number*

Phone Number

String

User's phone number in E.164 format (e.g. +6598765432)

* Required field for this object

If your company obtains your users' consent in compliance with the local regulations, make sure to pass the GDPR opt-in field to Insider. If you want to stop collecting and processing the data of an identified user, GDPR opt-in field should have the false value. Insider cannot be held liable if these obligations are not fulfilled and reserves the right to seek compensation from your company.

You can pass email or phone number as an identifier. Both of them are not required at the same time.

Once the user object is integrated into your website, you can provide Insider with the required fields (email, phone_number, gdpr_optin) whenever a user:

  • Logs in

  • Subscribes to a newsletter (e.g., through an input box on the footer)

  • Registers by providing their email (e.g., on the registration page)

For users whose gdpr_optin field is not defined or is false: The user object and/or the respective field should not be filled in

Checklist for any page where the user object is present:

  • Object window.insider_object.user returns to the page.

  • All properties are filled in when a user logs in.