BigQuery + GA4: Create GA4 Metrics using SQL in BigQuery — Part I
If you are not a Medium Member, please use this link to read this article.
Ever since GA4 has come into the picture, bigquery has been alongside since. The need for bigQuery intensifies when using GA4 due to its various limitations. Plus, bigQuery also acts as a key for companies who want to have their GA4 entire data in a warehouse, along with their, say, customers' data, for further reporting. This can give an end-to-end view to gather insights relevant to the business.
Since bigQuery collects raw data from GA4, everything in the form of dimensional value with complex nesting of rows, it becomes essential to write SQL queries to get metrics out of it. In this article, we are going to look at SQL queries for some of the metrics.
1. Number of Sessions
Sessions are like a short period window in which you visit the website. A session initiates when a user either opens the website or views a page and no session is currently active i.e. their previous session has timed out. By default, a session ends after 30 minutes of user inactivity. In GA4 there is a way to increase these 30 minutes, if required.