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

Session Id with multiple session number for the same user

Hello Everyone, 

I'm currently working on GA4 data stored in our BQ. While digging into it, I found that for a given day and user, there are multiple session numbers, which seems weird to me!

Indeed, I thought the unique key for a session is the concatenation of user_pseudo_id & ga_session_id, but in this case, it's not a valid approach.

Here's the example I'm referring to:

abenramd_0-1713861491991.png

Note: I replaced the real user_pseudo_id and ga_session_id  with fictive data for confidentiality reasons.

Thank you! 

Anes

6 3 834
3 REPLIES 3

Hi @abenramd , 

  Did you find any reasoning behind this behaviour. Is this a valid scenario or some issue at the data collection end. 

Regards

Neerav

Hi @abenramd  . I have faced a similar situation while working with Google Dailog Flow Data. In my case, the issue was with the data ingestion process. While data ingestion, multiple rows with the same data got added despite having the check on session start time. 

Hi @abenramd GA4 handles sessions differently than Universal Analytics (UA), and there are a few reasons why a user might have multiple session_numbers within what seems like a single session.

GA4 Can Restart Sessions Based on Certain Events

Unlike UA, GA4 may restart a session when a user triggers a new event with a different set of parameters.
This can happen if:

  • The user changes their traffic source within the same session.
  • There are issues with time zone configurations, causing unexpected session resets.

Difference Between session_id and session_number

  • ga_session_id: Represents a unique session identifier, generated when a user starts a new session.
  • session_number: A cumulative count of the total sessions a user has had over time.

It’s possible to see different session_number values within what appears to be the same session. This can be due to late-arriving events or data being processed at different times.

Data Collection and Latency Issues

GA4 uses an event-based processing system, meaning that data doesn’t always arrive in real time. This can cause inconsistencies in how sessions are assigned, leading to discrepancies.

How to Check This Behavior in BigQuery

If you want to analyze whether session identifiers are being assigned correctly, you can run the following query:

 

 
SELECT user_pseudo_id,
ga_session_id,
session_number,
COUNT(*) AS event_count
FROM `your_project.your_dataset.events_*`
WHERE event_date = 'YYYYMMDD'
GROUP BY user_pseudo_id,
ga_session_id,
session_number
ORDER BY user_pseudo_id,
ga_session_id;

This will help you verify if events are properly grouped under the same session.

Alternative Solution: Windsor.ai for GA4 to BigQuery Integration

If you need a simpler and more reliable way to extract GA4 data into BigQuery without session inconsistencies, you might want to consider Windsor.ai.

Why Windsor.ai?

Optimized data processing to avoid session mismatches.
Seamless integration between GA4 and BigQuery.
Support for multiple destinations, making data management easier.

Hope this helps!