> ## Documentation Index
> Fetch the complete documentation index at: https://chatbotx.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Facebook Ads - Custom Audience Integration

> Connect your Facebook Ads account with ChatbotX to automatically sync custom audience lists for your advertising campaigns.

**Facebook Custom Audience** is a tool that allows you to target potential customers by syncing contact information from your chatbot to Facebook Ads Manager.

You can use this feature to run remarketing campaigns targeting users who have interacted with your chatbot, or exclude existing buyers to optimize your ad spend.

## Connect Facebook Ads with ChatbotX

Before you can add users to custom audiences, you must connect your Facebook Ads account and grant permissions to ChatbotX.

<Steps>
  <Step title="Go to Integration Settings">
    From the left sidebar, click **Settings** > Select the **Integrations** tab from the top menu.
  </Step>

  <Step title="Connect Facebook Ads">
    Locate **Facebook Ads** in the list of integrations and click **Connect**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/uS-E_1TOAlUwBUGz/images/facebook_ads_integration_connect.png?fit=max&auto=format&n=uS-E_1TOAlUwBUGz&q=85&s=17891eba424066a7deb41aceae89aec9" alt="Facebook Ads Integration Connect" width="2891" height="1442" data-path="images/facebook_ads_integration_connect.png" />
    </Frame>
  </Step>

  <Step title="Log in to Facebook">
    A login window will open. Click **Continue as...** to log in using the personal Facebook account that manages your ad accounts.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/uS-E_1TOAlUwBUGz/images/facebook_ads_oauth_continue.png?fit=max&auto=format&n=uS-E_1TOAlUwBUGz&q=85&s=7986358f746330878c7ff2f65394c4d2" alt="Facebook Ads Oauth Continue" width="2892" height="1753" data-path="images/facebook_ads_oauth_continue.png" />
    </Frame>
  </Step>

  <Step title="Grant Ad Permissions">
    Ensure you grant all requested permissions for managing ad accounts and viewing stats, then click **Save**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/uS-E_1TOAlUwBUGz/images/facebook_ads_oauth_permissions.png?fit=max&auto=format&n=uS-E_1TOAlUwBUGz&q=85&s=62c93caca975168157a742e5d5629a21" alt="Facebook Ads Oauth Permissions" width="2894" height="1756" data-path="images/facebook_ads_oauth_permissions.png" />
    </Frame>
  </Step>

  <Step title="Complete Connection">
    Once the connection is confirmed, click **Got it** to close the window and complete the integration.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/uS-E_1TOAlUwBUGz/images/facebook_ads_oauth_connected.png?fit=max&auto=format&n=uS-E_1TOAlUwBUGz&q=85&s=a1e73f5ff0b4d650dd274b9a7cf1f498" alt="Facebook Ads Oauth Connected" width="2892" height="1757" data-path="images/facebook_ads_oauth_connected.png" />
    </Frame>
  </Step>
</Steps>

## Create a Custom Audience on Facebook

To allow ChatbotX to sync users to the correct list, you need to create a custom audience in Facebook Ads Manager first.

<Steps>
  <Step title="Open Audiences page">
    Open Facebook Ads Manager, navigate to the **Audiences** section, then click **Create Audience** and select **Custom Audience**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/uS-E_1TOAlUwBUGz/images/facebook_ads_create_custom_audience.png?fit=max&auto=format&n=uS-E_1TOAlUwBUGz&q=85&s=a3cc58aa270ddeb992e2b88bcdbe3083" alt="Facebook Ads Create Custom Audience" width="2542" height="1491" data-path="images/facebook_ads_create_custom_audience.png" />
    </Frame>
  </Step>

  <Step title="Select audience source">
    In the source selection window, choose your data source (e.g., **Facebook Page**).

    <Frame>
      <img src="https://mintcdn.com/chatbotx/uS-E_1TOAlUwBUGz/images/facebook_ads_custom_audience_source.png?fit=max&auto=format&n=uS-E_1TOAlUwBUGz&q=85&s=e8918b59a784d434883e6ca1365f6a13" alt="Facebook Ads Custom Audience Source" width="1458" height="1125" data-path="images/facebook_ads_custom_audience_source.png" />
    </Frame>
  </Step>

  <Step title="Configure and name audience">
    Select your Facebook Page, set your desired interaction criteria, name your audience, and click **Create Audience** to complete.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/uS-E_1TOAlUwBUGz/images/facebook_ads_custom_audience_setup_step1.png?fit=max&auto=format&n=uS-E_1TOAlUwBUGz&q=85&s=e2733f5823b9830d98d5696d25c0a248" alt="Facebook Ads Custom Audience Setup Step1" width="1645" height="1795" data-path="images/facebook_ads_custom_audience_setup_step1.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/chatbotx/uS-E_1TOAlUwBUGz/images/facebook_ads_custom_audience_setup_step2.png?fit=max&auto=format&n=uS-E_1TOAlUwBUGz&q=85&s=541cf84fd3f8377b53d1914caef185e3" alt="Facebook Ads Custom Audience Setup Step2" width="1248" height="1192" data-path="images/facebook_ads_custom_audience_setup_step2.png" />
    </Frame>
  </Step>
</Steps>

## Use Facebook Custom Audience Action in Flow Builder

Once connected, you can build automation flows to add or remove contacts from custom audiences based on their behavior in the chat.

<Steps>
  <Step title="Open Flow Builder">
    From the left sidebar, click **Flows** and open the flow you want to edit (or click **+ Create Flow**).
  </Step>

  <Step title="Add Facebook Custom Audience Action">
    In the message block editor, perform the following steps:

    1. Click **Actions** from the block element menu.
    2. In the actions panel, select the **Messenger** category.
    3. Click **Facebook Custom Audience** to add it to your flow.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/uS-E_1TOAlUwBUGz/images/facebook_custom_audience_flow_action.png?fit=max&auto=format&n=uS-E_1TOAlUwBUGz&q=85&s=696cdf719c1c683178f739e11e5e4174" alt="Facebook Custom Audience Flow Action" width="2926" height="1819" data-path="images/facebook_custom_audience_flow_action.png" />
    </Frame>
  </Step>

  <Step title="Configure Action settings">
    In the action configuration panel, configure the following:

    * **Ad Account**: Select your connected ad account.
    * **Action**: Select **Add to Custom Audience** or **Remove from Custom Audience**.
    * **Custom Audience**: Select the target custom audience you created on Facebook.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/uS-E_1TOAlUwBUGz/images/facebook_custom_audience_action_config.png?fit=max&auto=format&n=uS-E_1TOAlUwBUGz&q=85&s=578946279d83bc3bde82b9118e25542b" alt="Facebook Custom Audience Action Config" width="1394" height="962" data-path="images/facebook_custom_audience_action_config.png" />
    </Frame>
  </Step>
</Steps>
