Apple (App Store Connect)

Apple (App Store Connect)

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.

Learn more
PostHog Wizard hedgehog

Connect Apple (App Store Connect) to PostHog to sync your data into the PostHog data warehouse for analysis and modeling.

Pull your App Store apps, versions, builds, reviews and sales reports into the PostHog Data warehouse.

An Account Holder or Admin creates an API key under Users and Access → Integrations → App Store Connect API in App Store Connect. Copy the issuer ID and key ID from that page, then paste the contents of the .p8 private key file you download. Apple only lets you download that file once, so keep a copy.

Sales and subscription reports also need your vendor number (App Store Connect → Payments and Financial Reports) and a key with the Finance, Sales, or Admin role. Leave it blank if you only want app, review and build data.

Analytics report tables keep every restatement Apple publishes for a report date (about six days of revisions), so a raw SUM grouped by date overcounts. The raw rows preserve the restatement history; to aggregate, keep only the latest restatement per report date and dimension combination, for example:

SELECT
    raw.date,
    raw.app_id,
    raw.app_name,
    raw.app_apple_identifier,
    raw.app_version,
    raw.device,
    raw.platform_version,
    raw.source_type,
    raw.page_type,
    raw.app_download_date,
    raw.territory,
    argMax(raw.sessions, raw.processing_date) AS sessions,
    argMax(raw.total_session_duration, raw.processing_date) AS total_session_duration,
    argMax(raw.unique_devices, raw.processing_date) AS unique_devices
FROM appstoreconnect_analytics_app_sessions AS raw
INNER JOIN (
    SELECT app_id, date, max(processing_date) AS processing_date
    FROM appstoreconnect_analytics_app_sessions
    GROUP BY app_id, date
) AS latest
    ON raw.app_id = latest.app_id AND raw.date = latest.date AND raw.processing_date = latest.processing_date
GROUP BY
    raw.date,
    raw.app_id,
    raw.app_name,
    raw.app_apple_identifier,
    raw.app_version,
    raw.device,
    raw.platform_version,
    raw.source_type,
    raw.page_type,
    raw.app_download_date,
    raw.territory

This query names the table as connected without a table name prefix; if you set one, add it wherever the table name appears. Each analytics table's description carries the exact query for that table.

Configuration

OptionTypeRequired
Issuer IDtextYes
Key IDtextYes
Private key (.p8 contents)textareaYes
Vendor number (optional)textNo

Linking Apple (App Store Connect) to PostHog

  1. Go to the Data pipeline page in PostHog
  2. Click New source and select Apple (App Store Connect)
  3. Fill in the required configuration fields
  4. Click Next, select the tables you want to sync, and then press Import