Mapping Amplitude, Mixpanel, GA4, Heap and PostHog Event Schemas to Your Warehouse
If you have ever moved analytics data between vendors, or tried to land raw event exports from more than one tool in the same warehouse, you already know the problem: every vendor exports a different shape, and none of them line up.
This is a practical reference for the five export formats that come up most often — Amplitude, Mixpanel, GA4, Heap and PostHog — mapped field by field onto a single normalized event schema. The mappings below are the ones BillDog's own importers use in production, not a theoretical exercise, which is why the awkward edge cases are documented rather than glossed over.
The target schema
Everything normalizes to four fields. Keeping the target this small is deliberate: anything vendor-specific belongs inside properties rather than as a top-level column, or you end up with a table whose schema changes every time you add a source.
event_name string -- normalized name, e.g. $pageview
distinct_id string -- resolved user identifier
event_timestamp timestamp -- ISO 8601, UTC
properties json -- everything else
Two conventions are worth adopting even if you never use BillDog: prefix reserved/system properties with a dollar sign so they cannot collide with your own product properties, and normalize the handful of universal events (pageview, autocapture) to shared names so cross-source funnels are possible at all.
Amplitude
Amplitude's export is the richest of the five and the most work to normalize, mostly because identity is spread across three columns and it renames its own autocapture events with a bracketed prefix.
| Amplitude field | Maps to | Notes |
|---|---|---|
event_type | event_name | Renamed for autocapture events, see below |
user_id → device_id → amplitude_id | distinct_id | First non-null wins; order matters |
event_properties | properties | Keys remapped where bracketed |
user_properties | $set | Coerce literal "EMPTY" to null |
device_type | $device_type | Normalize casing |
os_name / os_version | $browser / $browser_version | Amplitude's os_name is the browser on web |
platform | $os | Genuinely inverted vs the naming you expect |
city / region / country | $geoip_* | Already resolved server-side |
Event name remapping, so that autocaptured interactions line up with every other source:
"[Amplitude] Page Viewed" -> "$pageview"
"[Amplitude] Element Clicked" -> "$autocapture"
"[Amplitude] Element Changed" -> "$autocapture"
Property keys carry the same bracketed prefix and need the same treatment — [Amplitude] Page URL becomes $current_url, [Amplitude] Page Path becomes $pathname, [Amplitude] Referrer becomes $referrer, and so on.
The two Amplitude traps
The literal string EMPTY. Amplitude writes the four characters EMPTY into user properties that have no value. Load that naively and you get a property whose most common value is the string "EMPTY", which quietly poisons every cohort built on it. Coerce it to null in transformation.
os_name is not the OS. On web exports, os_name carries the browser and platform carries the operating system. Mapping os_name to an $os column because the name suggests it is the single most common mistake in an Amplitude pipeline, and it is invisible until someone asks how many users are on iOS and the answer is "Chrome".
Mixpanel
Mixpanel nests almost everything under a single properties object and reserves the dollar-sign prefix for its own keys. Identity resolution is the same first-non-null pattern as Amplitude, with different column names.
| Mixpanel field | Maps to | Notes |
|---|---|---|
event | event_name | Normalize reserved names |
properties.$user_id → .distinct_id → .$device_id | distinct_id | First non-null wins |
properties.time | event_timestamp | Epoch seconds — convert to ISO |
properties.$insert_id | preserved | Your idempotency key |
other properties.* | properties | Internal keys dropped by prefix |
Keep $insert_id. It is stable across re-exports, which makes it the only correct deduplication key if your load is ever replayed. Hashing event name plus timestamp is the usual substitute and it collides for legitimate repeated actions inside the same second — two taps on the same button, and you silently drop one.
GA4 (BigQuery export)
GA4 is the hardest of the five to flatten, and it has nothing to do with the field names. It is the event_params structure.
Every parameter is a struct containing a key and a value struct with four typed columns — string_value, int_value, float_value, double_value — exactly one of which is populated. Extracting a single parameter means unnesting the array and coalescing across all four:
SELECT
event_name,
COALESCE(user_id, user_pseudo_id) AS distinct_id,
TIMESTAMP_MICROS(event_timestamp) AS event_timestamp,
(SELECT COALESCE(
CAST(p.value.string_value AS STRING),
CAST(p.value.int_value AS STRING),
CAST(p.value.float_value AS STRING),
CAST(p.value.double_value AS STRING))
FROM UNNEST(event_params) p
WHERE p.key = 'page_location') AS current_url
FROM `project.analytics_NNNNN.events_*`
WHERE event_name NOT IN ('session_start', 'first_visit')
Repeat that correlated subquery per parameter and the cost grows quickly. For anything beyond a handful of parameters, unnest once into a key/value staging table and pivot from there.
Name normalization follows the same principle as Amplitude: page_view maps to $pageview, and user_engagement, scroll and click all map to $autocapture. Identity is user_id falling back to user_pseudo_id.
Heap
Heap splits its export into separate event and user streams, which means user attributes arrive as their own records rather than attached to events. Normalizing means transforming both and joining on the identity column, or emitting the user records as identify-style events with a $set payload — the approach our importer takes, because it keeps a single event table as the only thing downstream models read.
Heap also autocaptures aggressively by default. If you are estimating warehouse cost or vendor event volume from a Heap baseline, expect the count to be substantially higher than a hand-instrumented equivalent.
PostHog
PostHog is the least work, because its export shape is already close to the target: event, distinct_id, timestamp and a flat properties object. The only real handling is that distinct_id sometimes appears at the top level and sometimes inside properties depending on the export path, so check both.
event -> event_name
distinct_id -> distinct_id (fall back to properties.distinct_id)
timestamp -> event_timestamp
properties -> properties (already $-prefixed for system keys)
The cross-cutting traps
Synthetic session events. Amplitude emits session_start and session_end; GA4 emits session_start and first_visit. These are vendor bookkeeping, not user actions. Load them alongside your own session logic and you double-count sessions; include them in a funnel and every step count inflates. Skip them on import.
Identity resolution order is a decision, not a detail. Every vendor gives you an authenticated ID, a device ID and sometimes an internal ID. Whichever order you resolve them in becomes the definition of a "user" for every downstream metric. Pick one order, write it down, and apply it identically across sources — otherwise the same person counts once in one source and twice in another, and your cross-source retention numbers are meaningless.
Timestamps. Mixpanel exports epoch seconds, GA4 exports microseconds, Amplitude and PostHog export ISO strings, and Amplitude and Heap both use a "YYYY-MM-DD HH:MM:SS.fff" variant that sometimes carries a trailing " UTC". Normalize to ISO 8601 UTC at the transformation boundary, never in the query layer.
Property key collisions. Once several sources land in one table, a product property named country will meet a vendor's geo-resolved country. This is exactly what the dollar-sign prefix convention prevents. Adopt it before you have the collision, not after.
Where this leads
The reason to normalize at all is that a warehouse table with one shape lets you write one set of models. The reason people put it off is that the mapping work above is unglamorous and easy to get subtly wrong — the Amplitude os_name inversion and the literal EMPTY string will both pass every test you think to write.
If you are doing this because you are moving off a tool rather than adding one, BillDog ships these exact transformations as importers in the dashboard — Amplitude, Mixpanel, GA4, Heap and PostHog event exports, plus a CSV/JSON subscriber roster importer — so historical funnels and retention do not restart at zero. The normalized schema above is the one they write to, and BillDog exports onward to Snowflake, BigQuery, Redshift and S3 if the warehouse remains your system of record.
Related reading
- BillDog vs PostHog — line-by-line rate card and where PostHog wins
- BillDog vs Mixpanel — analysis depth versus a connected loop
- Consolidating Amplitude and Braze — capability map and migration path
- Best analytics tools in 2026 — where each vendor genuinely wins
- Analytics integration docs · Pricing
Frequently asked questions
Why does every analytics vendor export a different event schema?
Each product modelled identity and event properties differently before any convention existed. Amplitude splits user_id, device_id and its own amplitude_id; Mixpanel nests everything under a properties object with $-prefixed reserved keys; GA4 exports parameters as an array of key/value structs with separate typed value columns; PostHog stays closest to a flat event/distinct_id/properties shape. None is wrong, but nothing lines up without an explicit mapping.
What is the hardest part of parsing a GA4 BigQuery export?
The event_params array. Each parameter is a struct with a key and a value struct containing string_value, int_value, float_value and double_value, only one of which is populated. Flattening it means unnesting the array and coalescing across all four typed columns for every parameter you want as a column.
Why does Amplitude export the string EMPTY in user properties?
Amplitude writes the literal four-character string EMPTY for absent user properties rather than null. A naive load treats it as a real value, so cohorts built on that property silently include users who have no value at all. Coerce it to null during transformation.
How do I deduplicate events when replaying a Mixpanel export?
Use the $insert_id property Mixpanel attaches to each event. It is stable across re-exports, so it is the correct idempotency key for a replayable load. Deduplicating on a hash of the event name plus timestamp will collide for legitimate repeated actions in the same second.
Should I drop session_start and session_end events on import?
Usually yes. Amplitude and GA4 both emit synthetic session boundary events. If you load them alongside your own session logic you double-count sessions, and any funnel that treats them as real user actions produces inflated step counts. Our importers skip them by default.
Get the BillDog newsletter
Practical guides on subscription pricing, paywalls and app growth, about twice a month. No spam.