Linking OpenAI Ads as a source

Alpha release

This source is currently in alpha. The interface and available tables may change.

The OpenAI Ads connector syncs your ChatGPT advertising data – campaigns, ad groups, ads, and daily performance insights – into the PostHog Data Warehouse, so you can analyze ad spend and delivery alongside your product data.

Prerequisites

You need an OpenAI Ads Manager account with API access. OpenAI Ads is currently a beta product available to US advertisers, and each API key is scoped to a single ad account.

Adding a data source

  1. In PostHog, go to the Sources tab of the data pipeline section.
  2. Click + New source and click Link next to this source.
  3. Enter your credentials (see Configuration below) and click Next.
  4. Select the tables you want to sync, choose a sync method and frequency, then click Import.

Once the syncs are complete, you can start querying this data in PostHog.

When linking OpenAI Ads, you'll need:

  • API key – create one in the Settings tab of OpenAI Ads Manager. Note this is different from an OpenAI platform API key, and the two are not interchangeable.

Because each key is scoped to one ad account, connect one source per ad account to import several accounts.

Sync modes

Each table can be synced in one of several modes, depending on what the source supports:

  • Webhook (when available) – the source pushes changes to PostHog in real time. Fastest freshness, lowest ongoing cost, and the only mode that reliably captures updates and deletes.
  • Incremental – only new or updated rows are synced on each run, using a cursor field (such as an updated_at timestamp). Cheaper than a full refresh, but deletes aren't captured.
  • Append only – new rows are appended using a cursor field; existing rows are never updated. Ideal for immutable, append-only tables like event logs.
  • Full refresh – the whole table is reloaded on every sync. Use it when a table has no reliable cursor or when you need deletions reflected.

See sync methods for a full explanation of how each mode works and how to choose between them.

The insights tables sync incrementally on start_time and hold one row per entity per day. Each incremental sync re-reads a trailing window of recent days, since OpenAI keeps restating recent reporting as delivery data catches up; the overlap is deduplicated automatically.

The campaigns, ad groups, and ads tables are full refresh only – the API doesn't offer a server-side date filter for them.

Configuration

OptionTypeRequired
API keypasswordYes

Supported tables

TableDescriptionSync methodIncremental fieldPrimary key
campaigns

Ad campaigns in the ad account. A campaign defines the budget, flight dates, and location targeting under which its ad groups deliver.

Full refresh
ad_groups

Ad groups in the ad account, listed per parent campaign. An ad group defines the bidding configuration and audience hints for the ads it contains.

Full refresh
ads

Ads in the ad account, listed per parent ad group. An ad carries the creative (title, body, image, target URL) shown to users in ChatGPT.

Full refresh
campaign_insights

Daily delivery metrics per campaign: impressions, clicks, spend, CTR, CPC, and CPM.

Incremental, Full refreshstart_time
ad_group_insights

Daily delivery metrics per ad group: impressions, clicks, spend, CTR, CPC, and CPM.

Incremental, Full refreshstart_time
ad_insights

Daily delivery metrics per ad: impressions, clicks, spend, CTR, CPC, and CPM.

Incremental, Full refreshstart_time
ad_account_insights

Daily delivery metrics for the whole ad account: impressions, clicks, spend, CTR, CPC, and CPM.

Incremental, Full refreshstart_time

Troubleshooting

  • 401 Unauthorized – your API key is invalid or has been revoked. Create a new one in the Settings tab of Ads Manager and reconnect.
  • 403 Forbidden – your API key doesn't have access to this ad account. Keys are scoped to a single ad account, so make sure you're using a key created for the account you want to import.

If your sync is failing or data looks wrong, see the Data warehouse troubleshooting guide. If that doesn't help, contact support – we're happy to help.

Community questions

Was this page useful?