Calculating GA4 Views and other related metrics in BigQuery

Creating GA4 Standard Metrics in BigQuery

In this post, I will show you how to calculate GA4 Views and two other Views related metrics in BigQuery.

Note: Page Views are called Views in GA4.

As always, we will use the concepts that we covered in the past, these concepts include unnest and subquery. If you are unfamiliar with them, please check out the past posts.

In GA4 Page Views are tracked as events. Since each logged event is in its own row, we can simply get the count of all the rows that have page_view event to count total page views.

Here is the SQL to get the count of total Views on any given day.

SELECT  count(*) 
FROM  `your-project.your-dataset.events_######`
WHERE event_name = 'page_view'

In addition to the Views metrics, GA4 also has “Views per session” and “Views per user” metrics.

To calculate those metrics, you can use Common Table Expressions (CTEs) and create calculated values in the final SQL.

If you want to know exactly how to do that then check the advanced sections.

Advanced Section

The advanced section is available for premium members only.

I highly encourage you to upgrade for a low price today and save a lot of hours, headaches, and money, while supporting this newsletter.

Are you enjoying this newsletter? Would you be willing to write a testimonial?
If yes then please hit reply with your comments.

Thank you,
Anil Batra,

P.S. Need help with GA4 BigQuery? Email me at [email protected]

Today in Digital MarketingEvery weekday at 5pm ET, get a complete news brief covering the day's events in digital marketing, social media, e-commerce, CRO, SEO, and online advertising.

Join the conversation

or to participate.