Connect PostHog¶
Connecting PostHog gives Squoosh a source to calibrate your synthetic shoppers against. Squoosh reads your recorded pageview traffic and shapes the shopper pool to match your real visitors, so experiment results reflect your actual audience. This page covers what the connection does and how to set it up from the Integrations page.
Beta
PostHog is a newly added connector. It calibrates device, geography, and traffic-source mix, plus a conversion rate when you set a conversion event — the same depth as Google Analytics and Shopify. If something looks off after connecting, check Troubleshooting below.
What the connection does¶
PostHog is a calibration source. Once connected, Squoosh reads pageview events from your PostHog project and builds synthetic shoppers whose mix of device, traffic source, and geography matches your real visitors — the same role Google Analytics or Shopify Analytics plays. Setting a conversion event also gives Squoosh a conversion rate to ground shopper behavior against.
The connection is not required to run a test — Squoosh can build a pool from a general e-commerce mix without it. For how the calibrated pool behaves and how the match is measured, see Synthetic shoppers.
Connect PostHog¶
You'll need a personal API key from PostHog with the Query Read (query:read) scope enabled, plus the project's host and ID.
- In the sidebar, click Integrations.
- In the PostHog row, click Connect.
- Enter:
- Personal API key — create one under your account's Settings → Personal API Keys, and make sure Query Read is checked when you scope it to the project — Squoosh's connection reads through PostHog's query API, which rejects a key that doesn't have this scope. Kept private; Squoosh never shows it again after you save it.
- Host — your PostHog instance's base URL, e.g.
https://us.posthog.com. Usehttps://eu.posthog.comfor the EU region, or your self-hosted instance's URL. There's no default — PostHog is region-specific, so this field is required. - Project ID — the PostHog project to read from, found on that project's Settings → Project page.
- Conversion event (optional) — the event name PostHog logs for a purchase or signup (for example
order_completed). Leave it blank if you don't want a conversion rate calibrated from PostHog. - Click Connect.
Squoosh verifies the key and project live before saving. The row shows Connected — syncing while the first calibration read runs, then Calibrating shoppers from PostHog once real data is grounding your shopper pool.
What it grounds¶
| Dimension | Source | Notes |
|---|---|---|
| Device | $device_type |
|
| Geography | $geoip_country_code |
|
| Traffic source | Referring domain + UTM medium/source | |
| Conversion rate | Distinct session count vs. your conversion event | Only when a conversion event is configured. |
A dimension needs a reasonable amount of traffic before Squoosh treats it as real signal — a handful of pageviews doesn't become a fabricated distribution. Below that floor, Squoosh leaves the dimension out of calibration rather than guessing.
Limits and caveats¶
- Host has no default. Because PostHog serves US/EU regions and self-hosted deployments, you must enter your instance's exact host.
- No conversion event configured means no conversion rate. Squoosh never invents one.
- Device and geography come straight from PostHog's own properties; traffic source is canonicalized into Squoosh's standard categories automatically.
- This connector reads live via PostHog's query API, not a batch export. PostHog's own docs ask third-party integrations to use its batch-export pipeline instead of querying live, and reserve the right to rate-limit or reject query traffic that looks like an export. Squoosh reads live today so calibration reflects recent traffic without a separate export/sync step to set up — a deliberate, monitored trade-off, not an oversight. If PostHog starts enforcing that policy against this connection, you may see occasional rate-limited connection errors; retrying after a short wait resolves it. Moving to batch exports is tracked as a follow-up if that starts happening regularly.
Troubleshooting¶
| Problem | What to do |
|---|---|
| Connection fails immediately | Double-check the host (must match your PostHog region or self-hosted instance exactly) and that the personal API key hasn't been revoked. |
| "Missing PostHog host or project ID" | Both Host and Project ID are required — reopen Connect and fill in both. |
| Connection fails with a permission/scope error | The personal API key is missing the Query Read scope — edit the key in PostHog (or create a new one) with Query Read checked for this project, then reconnect. |
| No conversion rate shows up | The Conversion event field is optional — add the exact event name PostHog logs for a purchase to get one. |
Related¶
- Synthetic shoppers — how the calibrated pool behaves and how the match is read.
- Connect Google Analytics and Connect Shopify — the original calibration sources.
- Connect a CSV import — an alternative if you'd rather export numbers from another tool.