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

How does GA4 assign session source

I'm trying to get an overview of all page views based on session source using BigQuery, but I see very large differences compared to the user interface.

What I am wondering, does Google use last non-direct click for this metric (that explains the differences)? I know it uses it for calculating conversions but I just want to understand how it assigns the source and medium at the start of a session.

3 1 272
1 REPLY 1

Hi @nv93 the differences you’re seeing between BigQuery and the Google Analytics 4 (GA4) UI likely come down to how GA4 assigns source and medium to a session.

Here’s the key thing to know:

  • For conversion attribution, GA4 uses the last non-direct click.
  • But for metrics like sessions and pageviews, the source and medium are set at the beginning of the session, based on the first recorded event.

Why This Matters in BigQuery

If you’re analyzing data at the event level instead of the session level, you might notice that some events have different session_source and session_medium compared to what you see in the GA4 interface.

💡 To get a more accurate view, make sure you're pulling these values from the session_start table rather than from each individual event.

A Simpler Alternative

If you’d rather avoid dealing with complex SQL logic, tools like Windsor.ai can help by extracting GA4 data with the correct attribution directly into Power BI, Looker Studio, or Google Sheets. This can help you:


Reduce discrepancies
Save time on data processing
Ensure consistency across reports

Hope this helps!