> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Linking Meta Ads as a source Canonical URL: https://posthog.com/docs/data-pipelines/sources/meta-ads > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://app.posthog.com` (app host for links). ## On this page - [Requirements](#requirements) - [Configuring PostHog](#configuring-posthog) - [Configuration](#configuration) - [Supported tables](#supported-tables) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_9608fcca70) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_dark_a92b0e022d) Let AI connect your sources for you Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog. `npx @posthog/wizard warehouse` ![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png) ![](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)Let AI connect your sources for you You can sync data from Meta Ads reports by configuring it as a source in PostHog. The supported reports that can be synced include Adsets, Campaigns, Ads, Adset Report, Campaign Report, and Ad Report, as described here: - [Adsets](https://developers.facebook.com/docs/marketing-api/reference/ad-account/adsets/) - [Campaigns](https://developers.facebook.com/docs/marketing-api/reference/ad-account/campaigns/) - [Ads](https://developers.facebook.com/docs/marketing-api/reference/ad-account/ads/) - [Adset Insight](https://developers.facebook.com/docs/marketing-api/reference/ad-account/insights/): filtered by level = `adset` - [Campaign Insight](https://developers.facebook.com/docs/marketing-api/reference/ad-account/insights/): filtered by level = `campaign` - [Ad Insight](https://developers.facebook.com/docs/marketing-api/reference/ad-account/insights/): filtered by level = `ad` Additional reports will be added based on user feedback we receive via our [in-app support form](https://app.posthog.com/#panel=support%3Afeedback%3Adata_warehouse%3Alow%3Atrue). ## Requirements - A Meta Ads account with permission to access data from accounts you want to sync. > **Tip:** If you need to find your account ID manually, go to [Ads Manager](https://adsmanager.facebook.com/) > Menu > Campaigns. You'll see a dropdown next to the title where you can find the ID, or check the URL: `https://adsmanager.facebook.com/adsmanager/manage/campaigns?act=YOUR_ID` ## Configuring PostHog Connect PostHog to your Meta Ads account using a Meta account. The Meta account must have permission to access data. 1. In PostHog, go to the **[Data pipelines](https://app.posthog.com/data-management/sources)** tab. 2. Open the **\+ New** drop-down menu in the top-right and select **Source**. 3. Find Meta Ads in the sources list and click **Link**. 4. Select an existing Meta Ads integration, or create a new one by clicking **Connect**. 5. Select the **Account ID** of the Meta Ads account you want to sync from the dropdown. Each account displays its status (Active, Disabled, or Closed). If your account doesn't appear, you can enter the account ID manually. 6. (Optional) Add a prefix for the table name. ## Configuration | Option | Description | | --- | --- | | `Meta Ads account` **Type:** oauth **Required:** True | | | `Account ID` **Type:** oauth-account-select **Required:** True | | | `Sync history for insights (days) - applies to every stats table` **Type:** number **Required:** False | A stats table that already imported keeps its current start date. A higher value pulls in older data only after you resync that table. | | `Attribution windows for insights (comma-separated, e.g. 7d_click,1d_view)` **Type:** text **Required:** False | | | `Use Meta's unified attribution setting` **Type:** select **Required:** False | | ## Supported tables | Table | Description | Sync method | Incremental field | Primary key | | --- | --- | --- | --- | --- | | `campaigns` | An advertising campaign in Meta Ads, defining the objective for its ad sets and ads. | Full refresh | — | — | | `campaign_stats` | Daily performance metrics (Insights) at the campaign level in Meta Ads. | Incremental, Full refresh | date\_start | — | | `adsets` | An ad set in Meta Ads, grouping ads that share a budget, schedule, and targeting. | Full refresh | — | — | | `adset_stats` | Daily performance metrics (Insights) at the ad set level in Meta Ads. | Incremental, Full refresh | date\_start | — | | `ads` | An individual ad in Meta Ads, pairing a creative with its ad set. | Full refresh | — | — | | `ad_stats` | Daily performance metrics (Insights) at the ad level in Meta Ads. | Incremental, Full refresh | date\_start | — | | `ad_account` | The Meta ad account this source syncs, including its currency, timezone and spend limits. | Full refresh | — | — | | `ad_creatives` | An ad creative in Meta Ads: the copy, imagery and call to action an ad is built from. | Full refresh | — | — | | `ad_images` | An image in the ad account's image library, referenced by ad creatives via its hash. | Full refresh | — | — | | `ads_pixels` | A Meta pixel owned by the ad account, used to track website conversions. | Full refresh | — | — | | `custom_conversions` | A custom conversion defined on the ad account, mapping pixel or offline events to an outcome. | Full refresh | — | — | | `campaign_stats_by_age_gender` | Daily campaign Insights split by the age and gender of the people reached. | Incremental, Full refresh | date\_start | — | | `campaign_stats_by_country` | Daily campaign Insights split by the country the ads were delivered in. | Incremental, Full refresh | date\_start | — | | `campaign_stats_by_region` | Daily campaign Insights split by the region, such as a state or province, the ads were delivered in. | Incremental, Full refresh | date\_start | — | | `campaign_stats_by_platform` | Daily campaign Insights split by where the ads appeared and what device they were seen on. | Incremental, Full refresh | date\_start | — | | `campaign_stats_hourly` | Campaign Insights split by hour of the day in the advertiser's timezone. Meta does not report unique metrics such as reach and frequency with hourly breakdowns, so this table omits them. | Incremental, Full refresh | date\_start | — | | `adset_stats_by_age_gender` | — | Incremental, Full refresh | date\_start | — | | `adset_stats_by_country` | — | Incremental, Full refresh | date\_start | — | | `adset_stats_by_region` | — | Incremental, Full refresh | date\_start | — | | `adset_stats_by_platform` | — | Incremental, Full refresh | date\_start | — | | `adset_stats_hourly` | — | Incremental, Full refresh | date\_start | — | | `ad_stats_by_age_gender` | — | Incremental, Full refresh | date\_start | — | | `ad_stats_by_country` | — | Incremental, Full refresh | date\_start | — | | `ad_stats_by_region` | — | Incremental, Full refresh | date\_start | — | | `ad_stats_by_platform` | — | Incremental, Full refresh | date\_start | — | | `ad_stats_hourly` | — | Incremental, Full refresh | date\_start | — | | `ad_stats_by_link_url` | Daily ad Insights split by the landing page each ad sent people to. Meta builds this split from creative assets. An ad that Meta reports no landing page asset for has no row here, so the total spend can be lower than in ad\_stats. Meta does not report unique metrics such as reach and frequency with creative asset breakdowns, so this table omits them. | Incremental, Full refresh | date\_start | — |