> ## Documentation Index
> Fetch the complete documentation index at: https://orwel-22af1265.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Meta Ads

> Connect Facebook and Instagram ads to see spend and cost per qualified lead next to Google.

Connect your Meta ad account and Orwel pulls your Facebook and Instagram campaigns with their daily spend, then ties each lead to its campaign through the campaign id in the landing URL. Meta campaigns appear in the same Campaigns screen as Google Ads.

Orwel only reads from Meta (`ads_read`). It never creates, edits or pauses ads.

## Connect

<Steps>
  <Step title="Open Integrations">
    In the dashboard go to **Integrations** and find **Meta Ads** under data sources.
  </Step>

  <Step title="Connect">
    Click **Connect**, log in with the Facebook account that manages your ads, and grant access to the ad accounts you want Orwel to read.
  </Step>

  <Step title="Pick the ad account">
    Choose the ad account for this workspace.
  </Step>
</Steps>

<Note>
  Some Meta logins issue tokens that expire after about 60 days. When that happens the card shows **Expires soon** and then **Access expired**: click **Reconnect** and approve again. Business logins with a system user token do not expire.
</Note>

## What gets synced

| Data | Grain |
| - | - |
| Campaigns (name, status) | Per campaign |
| Impressions, clicks, spend, conversions | Daily, per campaign |

Orwel syncs every 3 hours. The **Sync** button on the Campaigns screen runs it on demand.

## How leads are tied to campaigns

Meta has no click level report, so the click id it adds (`fbclid`) can prove that a visit came from a Meta ad but cannot be joined with spend. The join uses the campaign id in `utm_id`:

1. In each ad (or at the campaign level), set **URL parameters** to:

   ```text theme={null}
   utm_source=meta&utm_medium=paid&utm_campaign={{campaign.name}}&utm_id={{campaign.id}}
   ```

2. The SDK captures them on landing and sends them with the conversion. See [Attribution](/sdk/attribution).

3. The sync matches `utm_id` with the Meta campaign id. If `utm_id` is missing, it falls back to a campaign whose name matches `utm_campaign` exactly.

`utm_id` keeps working when you rename a campaign; `utm_campaign` does not.

## Troubleshooting

| Problem | What to do |
| - | - |
| No ad accounts to choose | During login, make sure the ad account was selected in the permissions screen. Reconnect and select it. |
| **Access expired** | Click **Reconnect**. |
| Meta leads show as direct | The ads have no URL parameters. Add the `utm_*` parameters above, then test a click with the [development key](/guides/dev-mode). |
| Leads with `fbclid` but no campaign | `fbclid` alone cannot be joined with spend. Add `utm_id={{campaign.id}}`. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.