Linking Unity Ads as a source

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.

PostHog Wizard hedgehog

The Unity Ads connector syncs your Unity Ads user acquisition statistics, SKAdNetwork (SKAN) installs, advertised apps, campaigns, and bids into the PostHog data warehouse. Use it to compare ad spend and installs with what those users do in your product.

Prerequisites

You need a Unity service account with access to your Unity Ads organization:

  • To sync the statistics tables (campaigns_daily, campaigns_daily_by_country, and skan_daily), give the service account the Advertise Stats API Viewer role.
  • To sync apps, campaigns, cpi_bids, or source_bids, enable the Advertising Management API for your organization and give the service account the Advertise API Viewer role.

When you pick tables, PostHog checks these roles and flags any tables your key can't access.

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 Unity Ads, you need:

  • Organization core ID – the numeric ID shown under Settings in the Unity Ads user acquisition dashboard
  • Key ID – the key ID of your service account key
  • Secret key – the secret key of your service account key

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.

campaigns_daily, campaigns_daily_by_country, and skan_daily hold one row per day and breakdown. They support incremental sync on timestamp. Each incremental sync reads the last 30 days again, because post-install metrics such as 7-day revenue keep changing for up to 28 days after the install.

The first sync of a statistics table reads 365 days of history. Unity keeps two years of statistics, but limits statistics requests to 30 per 30 minutes per IP address.

apps, campaigns, cpi_bids, and source_bids use full refresh. Each sync replaces the table.

Available tables

TableDescriptionSynced by default
campaigns_dailyUser acquisition statistics per day and campaignYes
campaigns_daily_by_countryUser acquisition statistics per day, campaign, and countryYes
skan_dailyDaily SKAdNetwork installs by campaign and conversion valueNo
appsApps advertised through Unity AdsNo
campaignsCampaign settings for each advertised appNo
cpi_bidsCampaign cost-per-install bids by countryNo
source_bidsCampaign bids by country and source appNo

skan_daily is off by default because it shares Unity's statistics rate limit with the other statistics tables. In campaigns, cpi_bids, and source_bids, the campaignSetId column holds the ID of the advertised app.

For field definitions, see Unity's Statistics API and Advertising Management API references.

Configuration

OptionDescription
Organization core ID
Type: text
Required: True

Shown under Settings in the Unity Ads user acquisition dashboard.

Key ID
Type: text
Required: True

To sync statistics, give the service account the Advertise Stats API Viewer role. To sync apps, campaigns, or bids, enable the Advertising Management API and add the Advertise API Viewer role.

Secret key
Type: password
Required: True

Supported tables

TableDescriptionSync methodIncremental fieldPrimary key
campaigns_daily

Unity Ads user acquisition statistics per day and campaign.

Incremental, Full refreshtimestamp—
campaigns_daily_by_country

Unity Ads user acquisition statistics per day, campaign and country.

Incremental, Full refreshtimestamp—
skan_daily

Daily SKAdNetwork installs by campaign and conversion value.

Incremental, Full refreshtimestamp—
apps

Apps advertised through Unity Ads.

Full refresh——
campaigns

Unity Ads campaign settings for each advertised app.

Full refresh——
cpi_bids

Campaign cost-per-install bids by country.

Full refresh——
source_bids

Campaign bids by country and source app.

Full refresh——

Troubleshooting

  • Invalid organization ID – the organization ID must be the numeric Organization core ID from Settings in Unity Ads.
  • Unauthorized (401) – Unity rejected the service account key. Create a new key and update the source.
  • Forbidden (403) on statistics tables – give the service account the Advertise Stats API Viewer role.
  • Forbidden (403) on apps, campaigns, or bid tables – enable the Advertising Management API for your organization and give the service account the Advertise API Viewer role.
  • Not found (404) – Unity found no organization with that ID. Use the Organization core ID from Settings in Unity Ads.

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.

Still have questions?

Was this page useful?