GA4 Export dbt Package
This dbt package transforms data from Fivetran's GA4 Export connector into analytics-ready tables.
Resources
- Number of materialized models¹: 7
- Connector documentation
- dbt package documentation
What does this dbt package do?
This package enables you to produce modeled tables that leverage GA4 Export data and replicate common GA4 reports. It creates enriched models with metrics focused on traffic acquisition, user acquisition, events, conversions, and session analysis.
Output schema
Final output tables are generated in the following target schema:
<your_database>.<connector/schema_name>_ga4_export
Final output tables
By default, this package materializes the following final tables:
| Table | Description |
|---|---|
| ga4_export__traffic_acquisition_session_source_medium_report | Analyzes session-level traffic acquisition to understand which sources and mediums drive website sessions, user engagement, and revenue. Corresponds to the traffic_acquisition_session_source_medium_report GA4 report. Example Analytics Questions:
|
| ga4_export__user_acquisition_first_user_source_medium_report | Tracks first-touch attribution to identify where new users originally come from and measure user acquisition effectiveness by source and medium. Corresponds to the user_acquisition_first_user_source_medium_report GA4 report. Example Analytics Questions:
|
| ga4_export__events_report | Summarizes event activity across your digital properties to analyze user interactions, engagement patterns, and revenue generated from specific events. Corresponds to the events_report GA4 report. Example Analytics Questions:
|
| ga4_export__conversions_report | Tracks key events (conversions) to measure goal completions, user actions, and total revenue to understand conversion behavior and performance. Corresponds to the conversions_report GA4 report. Example Analytics Questions:
|
| ga4_export__sessions_enhanced | Enriches session data with engagement metrics, event counts, and timing information to provide comprehensive session-level analytics for understanding user behavior patterns. Example Analytics Questions:
|
¹ Each Quickstart transformation job run materializes these models if all components of this data model are enabled. This count includes all staging, intermediate, and final models materialized as view, table, or incremental.
Prerequisites
To use this dbt package, you must have the following:
- At least one Fivetran GA4 Export connection syncing data into your destination.
- A BigQuery, Snowflake, Redshift, PostgreSQL, or Databricks destination.
Connector Restrictions
This package is designed for connections using the default column sync mode, not the json sync mode. It also assumes the underlying schema corresponds to connector versions synced after July 24, 2023.
For more information on the underlying schema, please refer to the connector docs and Google Analytics' documentation on the Export schema.
Database Incremental Strategies
Many of the models in this package are materialized incrementally, so we have configured our models to work with the different strategies available to each supported warehouse.
For BigQuery and Databricks All Purpose Cluster runtime destinations, we have chosen insert_overwrite as the default strategy, which benefits from the partitioning capability.
For Databricks SQL Warehouse destinations, models are materialized as tables without support for incremental runs.
For Snowflake, Redshift, and Postgres databases, we have chosen delete+insert as the default strategy.
Regardless of strategy, we recommend that users periodically run a
--full-refreshto ensure a high level of data quality.
How do I use the dbt package?
You can either add this dbt package in the Fivetran dashboard or import it into your dbt project:
- To add the package in the Fivetran dashboard, follow our Quickstart guide.
- To add the package to your dbt project, follow the setup instructions in the dbt package's README file to use this package.
How is this package maintained and can I contribute?
Package Maintenance
The Fivetran team maintaining this package only maintains the latest version of the package. We highly recommend you stay consistent with the latest version of the package and refer to the CHANGELOG and release notes for more information on changes across versions.
Contributions
A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions.
We highly encourage and welcome contributions to this package. Learn how to contribute to a package in dbt's Contributing to an external dbt package article.