How a session is defined

A session is a group of consecutive interactions between a user and a site, bound together by a time condition. Most analytics systems treat a session as finished when:

  • 30 minutes have passed since the last interaction;
  • midnight arrives (in some systems a new calendar day opens a new session);
  • the user closes the browser (configuration-dependent);
  • the traffic source changes (Universal Analytics behaviour — no longer applied in GA4).

Identification across sessions relies on a client_id — a unique value stored in a cookie or in localStorage. When the device changes or cookies are cleared, the old client_id is lost and a new one is created.

Session-level metrics

Metric What it measures E-commerce norm
Pages per session Depth of interaction 3–7 pages
Session duration Time engaged 2–5 min
Bounce rate % of single-page sessions 30–60% (depends on traffic)
Sessions with a purchase Session conversion 1–5%

Important: session duration is a secondary metric. A short session with a purchase beats a long one without. Steer by conversion, not by time.

Sessions in the context of personalization

Session context is one of the strongest signals available to recommendation algorithms. The sequence of products viewed inside the current session reflects present intent better than long-term history does: if someone is browsing running shoes, the algorithm should prioritise running rather than a winter coat bought months ago.

Session-based recommendations are built on exactly that principle and are especially valuable for new users, for whom no historical data exists.

What changes in single-page applications

In an SPA the traditional session logic breaks down: moving between sections produces no new page_view events. Analytics has to emit events manually on every route change through history.pushState. Without that, analytics and personalization platforms record the whole visit as one long view of a single page.