# Facebook Lead Ads

When you run Facebook ads, you can include forms to capture information about people who are interested in your products and services. This integration lets you add people who fill out your Facebook lead ad form to your Customer.io workspace, then trigger campaigns so you can convert your Facebook leads to customers or users.

## Overview[](#overview)

To set up a Facebook lead ads integration, you connect a page in your Facebook business account to Customer.io, activate the forms you want to capture leads from, and map fields from your forms to attributes.

When a person fills out your Facebook lead ad, Customer.io receives a `form_submit` event containing the Facebook lead form ID, the form name, and values representing the form submission.

This `form_submit` event adds a person to, or updates a person in, your workspace. You can also use it to trigger campaigns, add people to segments, etc.

 Form submissions must include `email` addresses

Your form needs an `email` field and form submissions must include an email address so we can tie form submissions to people. If people skip the `email` field in your form, Customer.io cannot use their submissions.

### Prerequisites[](#prerequisites)

To take advantage of this integration:

*   Your Facebook lead ad forms **must capture email addresses in a field called `email`**. People cannot skip this field, or we won’t be able to use their submissions.
*   Your workspace must use *email address* as a unique key to identify people.

Customer.io maps email addresses from your form to people—each email address represents a unique person in your workspace. You can map additional fields in your form to attributes in Customer.io.

You can connect one Facebook business page per workspace. If you have multiple pages, you’ll need to create additional workspaces to capture leads from each page.

 Your workspace must identify people by email to use this integration

Most workspaces are already set up to use email as an identifierThe attributes you use to add, modify, and target people. Each unique identifier value represents an individual person in your workspace.. But, if your workspace does not identify people by email address, you can

*   [add email as an identifier](/accounts-and-workspaces/workspaces/#migrate-workspace) or
*   [create a new workspace](/journeys/workspaces#add-a-workspace) to take advantage of this integration.

[![Lead ads page with an active form](https://docs.customer.io/images/lead-ads-page-with-forms.png)](#053866ae84ffb0c3abdc6a1241d8fe55-lightbox)

### Facebook Permissions and Authentication[](#facebook-permissions)

When you add a form to Customer.io, you’ll authenticate with Facebook and grant Customer.io access to your Facebook business account. This user must have the following permissions:

*   [Manage Page](https://www.facebook.com/help/187316341316631?helpref=faq_content)
*   [Leads Access](https://www.facebook.com/business/help/155909647811305?id=829106167281625)
*   [Business Management](https://www.facebook.com/business/help/299504287548592) (shown as “Manage your business” in the Meta UI)

We’ll confirm the pages you want to grant Customer.io access to and the permissions we’re requesting.

[![The authorization flow shows the permissions Customer.io needs](https://docs.customer.io/images/facebook-lead-ads-permissions.png)](#973894c83a25910c89997e5f7cf22de4-lightbox)

While you grant Customer.io access to your Facebook business and page, we don’t store your credentials. Instead, we request an access token from Facebook, which we use to authenticate with pages and lead ads. This token will not expire unless you revoke access to Customer.io from your Facebook business account.

## Set up a Facebook lead ads integration[](#set-up-a-facebook-lead-ads-integration)

Your workspace must let you [identify people by email address](/accounts-and-workspaces/workspaces/#migrate-workspace), and **your form must require people to fill out an `email` field** to use the Facebook lead ads integration.

1.  Go to *Data & Integrations* > *Integrations* > *Facebook Lead Ads*.
2.  Click **Sign in with Facebook to connect**.
3.  Enter your Facebook credentials and click **Log In**.

Customer.io now lists your Facebook lead ad forms, but you still need to [**Activate** the forms](#activate-a-lead-ad-form) that you want to use to add people to your workspace and trigger campaigns.

## Activate a lead ad form[](#activate-a-lead-ad-form)

When you activate a form, Customer.io begins capturing `form_submit` events whenever someone fills out the form. This event adds people to, or updates people in, your workspace, and can trigger campaigns.

When you activate a form, you map form fields to attributes you want to set on people in Customer.io.

1.  Go to *Data & Integrations* > *Integrations* > *Facebook Lead Ads*.
2.  Click **Activate** for the form you want to activate.
3.  Map form fields to attributes in Customer.io. Your form must have a field called `email` that captures email addresses.
    
    [![map form fields to attributes](https://docs.customer.io/images/map-form-fields%281%29.png)](#80288f827e5003248e2bc99ee2ab5b26-lightbox)
    
4.  (Optional) Click **Next** to assign or update **Added Attributes**. These are static attribute values that do not come from form fields and apply to everyone who fills out your form. These attributes are not unique to individual respondents.
5.  Click **Activate**.

## Manage form attributes[](#manage-form-attributes)

You can change the way fields in your active forms map to attributes in Customer.io.

1.  Go to *Data & Integrations* > *Integrations* > *Facebook Lead Ads*.
2.  Click the options icon, and select **Manage form**.
3.  Change the **Mapped Form Fields** or **Added Attributes**. If you disable an attribute, your form will still capture these values, and they’ll appear in `form_submit` events, but they won’t be set as attributes on people in Customer.io.
    
    [![manage form fields](https://docs.customer.io/images/manage-form-fields%281%29.png)](#4e922206f9019234d595ae1e61a29b3f-lightbox)
    
4.  Click **Save changes**.

## Test form events[](#test-form-events)

You can send test `form_submit` events representing a person who has already filled out your form to test campaigns or broadcasts triggered from Facebook lead ads.

 Test events do not affect attributes

Test events only test campaigns, messages, etc using the values from your form, but they cannot add or update people in your workspace. If you want to perform an end-to-end test, you can send a test event from the Facebook Lead Ads Testing Tool.

To send a test event:

1.  Go to *Data & Integrations* > *Integrations* > *Facebook Lead Ads*.
2.  Click the options icon, and select **Test form event**.
3.  Find the person you want your event to represent. This person must already exist in your workspace.
    
     Use a test person
    
    If you send a test event for a real member of your audience, you may inadvertently enter that person into a campaign or send them messages. We strongly recommend testing events using your own internal email address or a test address.
    
4.  Fill out test values for the form.
5.  Click **Send form\_submit event**.

## Troubleshooting[](#troubleshooting)

### Lead data retention[](#lead-data-retention)

Facebook retains lead data for 90 days. If your integration is disconnected or your access token is revoked, you won’t be able to add or update leads that were created more than 90 days ago.

### Test your form[](#test-your-form)

If you’re having trouble with your Facebook Lead Ads integration, verify that your app is subscribed and that it captures email addresses in a field called `email`.

1.  Go to [https://developers.facebook.com/tools/lead-ads-testing](https://developers.facebook.com/tools/lead-ads-testing).
2.  Select the page and form you want to test from the dropdowns.
3.  Click **Preview form** to verify your app is subscribed or click **Create lead** to test form submission.

[![Facebook lead ads](https://docs.customer.io/images/facebook-lead-ads-test.png)](#883bdcd8586e07d9d6f2996e02754da3-lightbox)

### Make sure email is a required field[](#make-sure-email-is-a-required-field)

If you create your form via Facebook Ads Manager, make sure that the `email` field is required. If people skip the `email` field, you won’t add or update them in Customer.io. Customer.io doesn’t know if a field is optional or required, so you’ll need to check this in your Facebook business account.

### CRM access error (103)[](#crm-access-error-103)

If you get an error response `103 - CRM access has been revoked from Lead Access Manager` when testing or using your Facebook Lead Ads integration, you need to have a Facebook Admin enable CRM access for the account you use to set up your Facebook Lead Ads integration.

Note that only a Facebook Admin can enable CRM access. You can’t do this from a regular user account, even if you have full control over ads and leads.

## Deactivate a form[](#deactivate-a-form)

Deactivating a form prevents it from sending events into Customer.io and capturing new respondents. Deactivating a form does not affect leads that already entered your workspace by filling out the form, nor does it archive a form in your Facebook business account.

1.  Go to *Data & Integrations* > *Integrations* > *Facebook Lead Ads*.
2.  Click the options icon for the form you want to modify, and select **Deactivate**.
3.  Type the form name and click **Deactivate**.

## Trigger a campaign from a form[](#trigger-a-campaign-from-a-form)

When you have *Active* Facebook lead ad forms, you can trigger campaigns whenever someone fills out a form.

 Using liquid in form-triggered campaigns

In your campaign, you can use liquid representing attributes you set from your form or properties from the `form_submit` event itself. You might want to use event properties if you want to reference a form field value that you don’t set as an attribute on people who fill out your form.

To set up a form-triggered campaign:

1.  Go to *Campaigns* and click **Create Campaign** or edit an existing campaign.
2.  Click **They fill out a form** and select the **Trigger form** that causes people to enter the campaign.
    
    [![Trigger campaign from a lead ad form](https://docs.customer.io/images/trigger-campaign-form.png)](#1a62a2af855f389a711e80473da55cae-lightbox)
    
3.  [Finish setting up your campaign as normal](/journeys/campaigns-in-customerio).

When you review and start your campaign, people who fill out the form on Facebook automatically enter your campaign, helping you automate a conversation with, and hopefully convert, your leads to customers or users!

You can see the campaign(s) triggered from your form on the Facebook lead ads integration page.

[![Lead ads page with an active form](https://docs.customer.io/images/lead-ads-page-with-forms.png)](#053866ae84ffb0c3abdc6a1241d8fe55-lightbox)