Datalad tool

GA4 BigQuery Recipe Library

Twenty queries every GA4 analyst ends up writing from scratch. Put your table name in once and every recipe below is ready to paste into BigQuery. The defaults point at Google’s public sample export, so you can run any of them right now without touching your own data.

1

Your export

project.dataset.events_* including the wildcard
YYYYMMDD
YYYYMMDD
Where a recipe lists rows

Why the date filter is on _TABLE_SUFFIX and not event_date

The export is one table per day. Filtering on _TABLE_SUFFIX stops BigQuery reading the days you did not ask for, so it is the difference between scanning a month and scanning your whole history. Filtering on event_date alone reads everything first, then throws most of it away, and you pay for all of it.

2

The recipes

Nothing matches that. Clear the search or pick another group.

Add a Comment

Leave a Reply

Subscribe to My Newsletter

Subscribe to my email newsletter to get the latest posts delivered right to your email. Pure inspiration, zero spam.

Discover more from Discuss Data Science, Machine Learning and Analytics

Subscribe now to keep reading and get access to the full archive.

Continue reading