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

# Meta Ads

> Connect Meta Ads to analyze advertising campaigns and performance

Connect Meta Ads to Adapt with an access token so Adapt can query your
Facebook and Instagram ad campaigns, spend, and performance.

## Set up credentials

<Steps>
  <Step title="Create a Meta app">
    In [Meta for Developers](https://developers.facebook.com/apps/), create
    an app (or use an existing one) with **Marketing API** access.
  </Step>

  <Step title="Generate an access token">
    Under **Marketing API > Tools**, generate a token with the `ads_read`
    permission for the ad account you want to connect.
  </Step>

  <Step title="Find your ad account ID">
    Copy the ad account ID from **Ads Manager** (format `act_<numbers>`).
  </Step>
</Steps>

## Connect to Adapt

<Steps>
  <Step title="Open Integrations">
    In Adapt, go to **Settings > Integrations**.
  </Step>

  <Step title="Find Meta Ads">
    Search for **Meta Ads** and select it from the catalog.
  </Step>

  <Step title="Start the connection">
    Click **Connect** to open the connection form.
  </Step>

  <Step title="Add your credentials">
    Enter the values you gathered above, then click **Add connection**:

    | Secret Name          | Value                                    |
    | -------------------- | ---------------------------------------- |
    | `META_ACCESS_TOKEN`  | Your Meta Marketing API access token     |
    | `META_AD_ACCOUNT_ID` | Your ad account ID, e.g. `act_123456789` |

    You can rename the connection and choose whether it is shared with your
    organization or kept personal to you.
  </Step>

  <Step title="Test the connection">
    Ask Adapt about your ad account's performance.
  </Step>
</Steps>

### Security

* Credentials are encrypted at rest with AES-256
* Use a token scoped only to `ads_read` unless you also need write access
* Rotate tokens regularly and remove any you no longer use

## Capabilities

Adapt can query your Meta Ads campaigns, ad sets, ads, and performance
metrics within what the token allows.

### Examples

```
How did our Meta Ads campaigns perform last week?
```

```
Which ad sets have the highest cost per click this month?
```

```
Summarize spend by campaign for the last 30 days.
```

```
Which ads have the best conversion rate?
```
