# Meta Marketing

This Integration requires Fides Cloud or Fides Enterprise. For more information, [talk to our solutions team. (opens in a new tab)](/content/speak-with-us?utm_source=docs-site/index.html)

[Meta's Marketing API (opens in a new tab)](https://developers.facebook.com/docs/marketing-apis) provides programmatic management of advertising assets, enabling automated synchronization and erasure of user-identifiable data within [Custom Audiences (opens in a new tab)](https://developers.facebook.com/docs/marketing-api/audiences/guides/custom-audiences). This integration enables automated Data Subject Requests (DSR) by facilitating the technical removal of specific users from Meta Custom Audiences, helping ensure compliance with privacy regulations such as GDPR and CCPA.

## Prerequisites

In order to [integrate](/content/docs/integrations/index.html) with Meta Marketing, you'll need to collect the following information:

| Name | Description |
| :-- | :-- |
| **Access Token**\* | A System User Token with `ads_management` and `ads_read` scopes. System User Tokens are permanent and do not expire after 60 days, unlike standard User Access Tokens. See [Meta's documentation (opens in a new tab)](https://developers.facebook.com/docs/marketing-api/system-users) on creating a System User. |
| **Ad Account ID**\* | The ID of the Ad Account to operate against. Found in your [Meta Business Manager (opens in a new tab)](https://business.facebook.com/latest/settings/business_info) settings, on the business info tab. |

### Setting up a Developer App

In order to have permissions to access the Marketing API you have to set up a Meta Application with the _Marketing_ permissions enabled.

1. Navigate to the [Facebook Developers apps dashboard (opens in a new tab)](https://developers.facebook.com/apps).
2. Select Create App.
3. Select Other on the "Use cases" step, then select Business as the app type. Provide a display name and contact email, then select the target Meta Business Manager account to own the app.
4. Within the App Dashboard, navigate to Add Products in the left sidebar.
5. Locate Marketing API and click Set Up.

### Setting up a System User Token

Meta requires a System User Token for automated DSR processing. Unlike standard user tokens, System User Tokens do not expire and are not tied to an individual's login session.

1. Log in to [Meta Business Manager (opens in a new tab)](https://business.facebook.com/).
2. Navigate to **Business Settings** → **Users** → **System Users**.
3. Create a new System User or select an existing one.
4. Click **Generate New Token** and select your Developer App created on the previous step.
5. Enable the `ads_management` and `ads_read` scopes.
6. Copy the generated token — this is your **Access Token**.
7. Ensure the System User has **Full Control** assigned over both the Developer App and the Ad Account in Business Manager settings.

## Integrating with Meta Marketing

To integrate an existing system with Meta Marketing:

1. Navigate to **Data map** → **View Systems** and choose the system that you want to connect.
2. Click on the **Integrations** tab.
3. Pick the vendor or system type that you want to integrate with from the **Connection type** drop-down menu.
4. Complete the required fields for the integration and click **Save**.

You may confirm your connection is working using the **Test connection** button, if desired.

To learn more, please see our guide for [Managing Integrations](/content/docs/integrations/guides/manage-integrations/index.html).

## Technical detail

Fides utilizes _API endpoints_ to access the _API service_ for a SaaS application. An _API service_ is the programmatic interface through which Fides can query and update data within an application to access, rectify, or delete personal information. Each SaaS tool will have a unique set of endpoints to enable privacy functions.

### Identity matching and hashing

Meta uses a "Blind Matching" framework — clear-text PII is never transmitted or stored in its original form. Fides automatically normalizes and hashes identifiers using SHA-256 before sending them to the API.

| Identity type | Normalization |
| :-- | :-- |
| **Email** | Lowercased, whitespace trimmed, then SHA-256 hashed |

### Meta Marketing endpoints

In the table below, you can find which endpoints are used for each type of privacy function. Clicking on the endpoint will take you to the documentation for that endpoint.

| Privacy function | Action | Description |
| :-- | :-- | :-- |
| **Erasure Requests** | [Global User Erasure (opens in a new tab)](https://developers.facebook.com/documentation/ads-commerce/marketing-api/audiences/guides/custom-audiences#remove) | Removes a user from every audience in the Ad Account. This is the primary endpoint used by Fides for DSR erasure.
