/GA4-bigquery-tips

Helpful queries on top of the GA4 BigQuery export. Content in here follows Adswerve's GA4 bigquery tips blog posts.

GNU General Public License v3.0GPL-3.0

GA4 Bigquery Queries And Tips

Helpful queries on top of the GA4 BigQuery export. Content here follows Adswerve's GA4 BigQuery tips blog posts.

Blog Articles

  1. Universal Analytics to GA4 BigQuery Export Guide
  2. GA4 BigQuery Export Guide - Users and Sessions
  3. GA4 BigQuery Export Guide - Event Parameters and Other Repeated Fields
  4. GA4 BigQuery Export Guide - Guide to Attribution
  5. Using Unpivot and Qualify with GA4 BQ Export
  6. GA4 BigQuery Export - A Quick Overview

Queries in this Repository

traffic-source-query.sql

This query tries to replicate session traffic source information from the GA4 UI. By identifying the first source of each session and also taking care of "direct" visits from users with previously identified traffic source.

rule-based-attribution-modeling.sql

This query includes 5 different attribution models on top of the GA4 BigQuery export taking the traffic-source-query.sql as an input.

channelGrouping.sql

A definition of a UDF, that takes medium, source, campaign and potential additional site categorizations to provide GA4-like channel grouping. The UDF was built based on the official documentation.

channelGrouping_test.sql

A few quick tests of the channel grouping function.