GA4 Session Metrics to BigQuery Mapping

Here’s a breakdown of GA4 Session Metrics and their corresponding BigQuery fields:

GA4 Session MetricsWhat it isBigQuery Field Name (Formula)
Average session durationThe average length of time, in seconds, that users spend during a session.AVG(session_duration_sec) AS average_session_duration
Bounce rateThe percentage of sessions that did not meet the engagement criteria.100 * (COUNTIF(totals.bounces > 0) / COUNT(session_id)) AS bounce_rate
Engaged sessionsThe number of sessions that lasted 10 seconds or more, included one or more key events, or had at least two page or screen views.COUNTIF(engaged_time_msec > 10000 OR event_count > 1) AS engaged_sessions
Engaged sessions per userThe average number of engaged sessions per user.AVG(COUNTIF(engaged_time_msec > 10000 OR event_count > 1) OVER (PARTITION BY user_pseudo_id)) AS engaged_sessions_per_user
Engagement rateThe percentage of sessions that were engaged sessions.100 * (COUNTIF(engaged_time_msec > 10000 OR event_count > 1) / COUNT(session_id)) AS engagement_rate
Low engagement sessionsThe count of sessions that did not meet the engagement criteria.COUNTIF(engaged_time_msec <= 10000 AND event_count <= 1) AS low_engagement_sessions
Session key event rateThe percentage of sessions that converted, calculated as the ratio of sessions with key events to total sessions.100 * (COUNTIF(key_event_occurred = 1) / COUNT(session_id)) AS session_key_event_rate
SessionsThe count of sessions that began on your website or app.COUNT(DISTINCT session_id) AS sessions
Sessions per userThe average number of sessions per user.AVG(COUNT(DISTINCT session_id) OVER (PARTITION BY user_pseudo_id)) AS sessions_per_user
Views per sessionThe number of app screens or web pages viewed per session.AVG(page_views) OVER (PARTITION BY session_id) AS views_per_session

Points to consider

  • Average session duration: Assumes session_duration_sec is a calculated field representing the total duration of each session in seconds.
  • Bounce rate: Assumes totals.bounces is a field indicating whether a session is a bounce. This field and calculation method might need to be adjusted based on your specific data structure.
  • Engaged sessions: Assumes engaged_time_msec represents the total engagement time in milliseconds and event_count represents the number of events in a session. Adjust the criteria based on your engagement definition.
  • Session key event rate: Assumes key_event_occurred is a flag indicating whether a key event occurred during the session. This might require custom logic to set based on your event data.
  • Sessions per user and Views per session: These calculations use COUNT(DISTINCT session_id) and average page views per session, assuming page_views is a field or calculated metric representing the number of page views in each session.

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade