Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

calculation of sessions in Bigquery

Hi All,

I am using Bigquery to replicate the GA4 dashboard using Data Studio. I have a query regarding the calculation of total sessions. I went across many blogs which says that to calculate the total sessions we should count_distinct(user_pseudo_id + event_time_stamp) for all session start events. 

But while researching more there are many sessions for which session_start event does not trigger and GA4 assigns a session_id to that sessions. Is the correct way to caluclate sessions is to use count_distinct(user_pseudo_id + ga_session_id) ?

0 2 1,508
2 REPLIES 2

You need posting this question to Google Analytics group or  stackoverflow.

 

Hi @mahewashabdi 

In Google Analytics 4, default session timeout is also 30 minutes. Beyond that default, session timeout can be adjusted to up to 7 hours and 55 minutes. However, the definition of "timeout" is slightly different. There's a new default user engagement event that acts as a timer by sending events to GA4 periodically. However, if the site or app isn't in the foreground, those events do not fire. If no timing events or others are sent after 30 minutes, the session has expired. With this new default behavior, the concept of timeout is more accurate.

Here are few articles to understand the concept in a broader and deeper way.

  1. https://www.bounteous.com/insights/2021/12/02/understanding-sessions-google-analytics-4/#:~:text=In%....
  2. https://www.optimizesmart.com/understanding-google-analytics-4-sessions/

Hope this helps!

Thanks