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

# ETL: Facebook Ads Destination

> Use the Facebook destination component to store the output of a data flow in Facebook cloud object. The destination component uses Facebook ads API.

<Frame>
  <img src="https://mintcdn.com/integrateio/2ttHYDu3EKov-VoY/images/creating-packages/using-components-facebook-ads-destination/image-1.png?fit=max&auto=format&n=2ttHYDu3EKov-VoY&q=85&s=3f8b04ea4e3be158eae3cc2388438227" alt="Facebook Ads destination component in the pipeline designer" width="1200" height="828" data-path="images/creating-packages/using-components-facebook-ads-destination/image-1.png" />
</Frame>

## Connection

Select an existing Facebook connection or create a new one (for more information, see [Allowing Integrate.io ETL access to my data on Facebook](/etl/allowing-integrateio-etl-access-to-facebook-ads-insights-data/).)

### Required Permission & Terms of Service

* **People's Access ([link](https://business.facebook.com/settings/people))** - Click Users and select people, make sure you have admin access to your business manager ([Details](https://www.facebook.com/business/help/442345745885606?id=180505742745347) about employee and admin access)

  <Frame>
    <img src="https://mintcdn.com/integrateio/OwEKdS5aIKsEcmhX/images/creating-packages/using-components-facebook-ads-destination/image-2.png?fit=max&auto=format&n=OwEKdS5aIKsEcmhX&q=85&s=eac2893e9dce925de9e83045352b499c" alt="Business Manager People settings showing admin access" width="1200" height="513" data-path="images/creating-packages/using-components-facebook-ads-destination/image-2.png" />
  </Frame>
* **Conversions**
  * Make sure you have access to development pixel ([link](https://business.facebook.com/settings/pixels))
    <Frame>
      <img src="https://mintcdn.com/integrateio/OwEKdS5aIKsEcmhX/images/creating-packages/using-components-facebook-ads-destination/image-3.png?fit=max&auto=format&n=OwEKdS5aIKsEcmhX&q=85&s=ad9fcff5025adf74350716e88192fff5" alt="Business Manager Pixels settings showing development pixel access" width="1200" height="513" data-path="images/creating-packages/using-components-facebook-ads-destination/image-3.png" />
    </Frame>
* **Customers**
  * Make sure you have access to ads account ([link](https://business.facebook.com/settings/ad-accounts))

    <Frame>
      <img src="https://mintcdn.com/integrateio/OwEKdS5aIKsEcmhX/images/creating-packages/using-components-facebook-ads-destination/image-4.png?fit=max&auto=format&n=OwEKdS5aIKsEcmhX&q=85&s=01c385d74ef4d611c2406ac10d44e933" alt="Business Manager Ad Accounts settings page" width="1200" height="566" data-path="images/creating-packages/using-components-facebook-ads-destination/image-4.png" />
    </Frame>

    * if your Ads Account is directly associated with your personal Facebook account, follow this [link](https://www.facebook.com/ads/manage/customaudiences/tos.php) and accept the Terms of Service. Even if your Ads Account is in a Business Manager account you also need to accept the Terms of Service within your business manager account.

## Destination Properties

* **Target object** - select the name of the target object (Conversions or Customers) in your Facebook ads.

### Operation type

* **Insert -**  inserts new data into the selected object according to pixel or custom audience id
* **Replace** - updates existing data in the selected object according to custom audience id (only Customers object)
* **Delete** - deletes data in the destination object according to custom audience id (only Customers object)

### Advanced options

* **Batch size** - number of records that are inserted to Facebook ads in each batch (Conversions maximum batch size: 1000;  Customers maximum batch size: 10000).
* **Maximum errors** - maximum number of records Facebook can reject within a batch before the task fails. The task fails when the number of rejected records in any single batch exceeds this threshold. Set this to `0` to fail on the first rejection. Set it higher to tolerate a known volume of bad data, such as malformed email or phone values for Customers. Set it to a negative value (for example, `-1`) to disable the check entirely so Facebook rejections never fail the task. The actual number of errors across the job may be greater than this value because batches run in parallel.

  When the threshold is exceeded, the task log includes the rejection samples Facebook returned, grouped by reason. The log fingerprints each sample value: it keeps only the first eight characters and replaces the rest with `***`. This prevents personally identifiable data (email, phone, hashed user identifiers) from being written in full. For example:

  ```text theme={null}
  Facebook Ads rejected 47 record(s) in this batch, which exceeds the configured maxFailedRecords threshold of 10. Sample failures reported by Facebook: [Invalid hash — 42 sample(s); e.g. a1b2c3d4***; e.g. e5f6g7h8***; e.g. i9j0k1l2***; ... and 39 more] [Invalid value — 5 sample(s); e.g. not-an-***; e.g. user@exa***]
  ```

  Use the reason text (for example, `Invalid hash`, `Invalid value`) to identify which transformation step produced bad data. `Invalid hash` typically means you sent a Customers field unhashed, or hashed with the wrong algorithm. Facebook requires SHA-256 hashed values for personally identifiable fields like email and phone. Use the eight-character fingerprint to correlate a rejection back to a row in your source data.

### Pixel ID and Customer Audience ID

* **Pixel ID** (Conversion Object) -  account id recognition for Facebook Ads
* * Access your Meta Business Settings ([link](https://business.facebook.com/settings/))

    * On Data Sources section click Pixels and find the pixel ID underneath the title

    <Frame>
      <img src="https://mintcdn.com/integrateio/OwEKdS5aIKsEcmhX/images/creating-packages/using-components-facebook-ads-destination/image-5.png?fit=max&auto=format&n=OwEKdS5aIKsEcmhX&q=85&s=766cf8ec45df2e88cfb5af5686f8a34b" alt="Pixel ID shown under the pixel title in Data Sources" width="1200" height="566" data-path="images/creating-packages/using-components-facebook-ads-destination/image-5.png" />
    </Frame>
* **Custom Audience ID** (Customer Object) - audience id recognition for Facebook Ads
* Access your Meta Business audiences ([link](https://business.facebook.com/adsmanager/audiences))

  * If you already had an existing Custom Audience, please skip this step. On **Create Audience** dropdown button, select **Custom Audience**

  <Frame>
    <img src="https://mintcdn.com/integrateio/OwEKdS5aIKsEcmhX/images/creating-packages/using-components-facebook-ads-destination/image-6.png?fit=max&auto=format&n=OwEKdS5aIKsEcmhX&q=85&s=5be710ac8667041c024bc322b3f7b4be" alt="Create Audience dropdown with Custom Audience option" width="696" height="1562" data-path="images/creating-packages/using-components-facebook-ads-destination/image-6.png" />
  </Frame>

  And then select **Customer list** (currently supported for sources in customer audience), download file template and set desire customer list file format on **.csv** or **.txt** format

  <Frame>
    <img src="https://mintcdn.com/integrateio/OwEKdS5aIKsEcmhX/images/creating-packages/using-components-facebook-ads-destination/image-7.png?fit=max&auto=format&n=OwEKdS5aIKsEcmhX&q=85&s=5a3475e7cec3b2b6ba05fa3ea240f0d0" alt="Customer list source selection for Custom Audience" width="1200" height="990" data-path="images/creating-packages/using-components-facebook-ads-destination/image-7.png" />
  </Frame>

  <Frame>
    <img src="https://mintcdn.com/integrateio/OwEKdS5aIKsEcmhX/images/creating-packages/using-components-facebook-ads-destination/image-8.png?fit=max&auto=format&n=OwEKdS5aIKsEcmhX&q=85&s=f11cccc444b669e352121baa0c239517" alt="File template download with CSV and TXT format options" width="1200" height="753" data-path="images/creating-packages/using-components-facebook-ads-destination/image-8.png" />
  </Frame>

  * On the Columns drop down, make sure the **Audience ID** checkbox is checked 

  <Frame>
    <img src="https://mintcdn.com/integrateio/OwEKdS5aIKsEcmhX/images/creating-packages/using-components-facebook-ads-destination/image-9.png?fit=max&auto=format&n=OwEKdS5aIKsEcmhX&q=85&s=3f94fe6bf09ac9fe5a1c8fe6ca28c982" alt="Columns dropdown with Audience ID checkbox enabled" width="505" height="400" data-path="images/creating-packages/using-components-facebook-ads-destination/image-9.png" />
  </Frame>

  * You will find the list of **Audience ID**s on the most right column 

  <Frame>
    <img src="https://mintcdn.com/integrateio/OwEKdS5aIKsEcmhX/images/creating-packages/using-components-facebook-ads-destination/image-10.png?fit=max&auto=format&n=OwEKdS5aIKsEcmhX&q=85&s=c8a5a86a586afa5accf2d5117cb156aa" alt="Audience ID column visible in the audiences list" width="1200" height="614" data-path="images/creating-packages/using-components-facebook-ads-destination/image-10.png" />
  </Frame>

  * Finally, please confirm when your cursor hover around **i** symbol the audience is ready for use. Make sure that the selected Audience is a Custom Audience type and using "Customer list" as its source. 

  <Frame>
    <img src="https://mintcdn.com/integrateio/OwEKdS5aIKsEcmhX/images/creating-packages/using-components-facebook-ads-destination/image-11.png?fit=max&auto=format&n=OwEKdS5aIKsEcmhX&q=85&s=b5e4985511068d686209469fa4dc9711" alt="Hover tooltip confirming Custom Audience is ready for use" width="592" height="296" data-path="images/creating-packages/using-components-facebook-ads-destination/image-11.png" />
  </Frame>

## Schema Mapping

Select the required and optional fields to use in the destination according to the object. (For more details on fields for each object: [conversions](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/server-event) & [customers](https://developers.facebook.com/docs/marketing-api/audiences/guides/custom-audiences/))
