GA4 Session ID
The GA4 session ID is a timestamp-based value, sent as `sid`, that groups a user's events into a single visit. It travels with the session number (`sct`) and an engagement flag (`seg`), which together tell GA4 when a new session starts.
Why it matters
Every event needs to belong to a session so you can measure visit duration, page depth, and engagement. GA4 groups events by session, not by individual page view. When a user comes back after their session times out, they get a fresh session id so that return visit counts as a new session, not a continuation.
Session count is a key metric for traffic analysis. If your session IDs are wrong or missing, you can't tell whether a spike is more visits or the same few users clicking more pages.
How it works
GA4 uses a timestamp-based session ID. When a user first lands on your site, GA4 creates a session with a unique sid value. That ID travels on every hit for 30 minutes by default. If the user goes quiet for 31 minutes or longer, the next event gets a fresh session ID and a new session count (sct).
The session also carries an engagement signal (seg). If a user triggers a user-engagement event (a scroll, a click on a link, a form submission), the engagement flag marks the session as engaged. Sessions with no engagement register as bounces in your reports.
Two hidden fields ride along: _ss (session start, 1 for the first event of a session) and _fv (first visit, 1 for the user's first session ever). These help GA4 distinguish a fresh visitor from a returning user.
What does not matter
The exact format of the session ID is not something you configure. GA4 generates it. You don't need to validate it or parse it on your site.
Reopening a tab doesn't automatically start a fresh session if you do it within 30 minutes. The session continues. But if that tab sits idle for 31 minutes, the next hit gets a new session ID.
Server-side implementations of GA4 can push custom session IDs if you want to control how sessions are grouped, but most sites use GA4's default timestamp logic.
Code example
A typical GA4 hit carries these session-related parameters:
POST /g/collect?v=2&tid=G-XXXXXXX HTTP/1.1
Content-Type: application/x-www-form-urlencoded
sid=1726234567890&sct=2&seg=1&_ss=1&_fv=0&cid=1234567890.1234567890&en=page_view
Decoded: session ID is 1726234567890, this is event 2 of the session (sct=2), the session is engaged (seg=1), this is the first event of this session (_ss=1), and this is not the user's first visit (_fv=0).
How Scalpel shows it
Scalpel Tags groups sid, sct, seg, _ss, and _fv into one Session section in the decoded hit table. You can spot new sessions at a glance: look for _ss=1 and watch sct increment. If seg stays 0, the session has no engagement and will count as a bounce.