The Measurement Room
dbt-ga4: the community standard for modelling the GA4 BigQuery export
A dbt package that turns the raw GA4 BigQuery export into report-ready models for sessions, users, ecommerce and attribution.
The GA4 BigQuery export lands as one semi-structured events_* table per day, an event per row, parameters nested and repeated. Useful for a warehouse, useless for a straight SELECT. dbt-ga4 is a dbt package that unnests it into staging and mart-level models: sessions, users, pageviews, ecommerce, and multi-channel attribution, ready to query or plug into a BI tool.
Why it made the cut
It is the closest thing GA4 modelling has to a default answer. It sits on dbt's official Package Hub, has been maintained since GA4 export first shipped, and is the package most agencies and in-house data teams reach for before writing their own unnesting logic from scratch. When someone asks "how do I get sessions out of the GA4 export properly", this package is usually the reply.
How to run it
- Add the package to
packages.ymlin your dbt project and rundbt deps. - Point the package's source config at your GA4 export dataset and property ID.
- Run
dbt buildto materialise the staging and mart models, then query the sessions or ecommerce marts directly. - Read the package's own docs for the session and channel-grouping logic before you rely on it for reporting, so you know how it defines a session and where that might differ from the GA4 UI.
Worth knowing
This models the export faithfully, it does not reconcile GA4's own session counts, which use a different, partly undocumented methodology. Expect some drift between what this package reports and what the GA4 interface shows. It is also a serious dbt undertaking, not a five-minute query: budget time for the initial build and for understanding the session/channel logic before you trust it in front of a client.