Sessions and Real-time

Exactly what a session is, what the bounce rate and average visit are divided by, and how fresh the real-time card on your dashboard is.

Session Boundaries

Klar sets no cookie, so it cannot follow a browser from one visit to the next. Instead the server derives a session id from the visitor's daily hash (site, IP address and User-Agent, salted with a secret that rotates every UTC day) and the current 30-minute clock window. Every pageview of one visitor that lands in the same window belongs to one session.

  • A fixed window, not an inactivity timer. Windows start on the hour and on the half hour, UTC (:00 and :30). A visit that begins at 10:29 and carries on at 10:31 is counted as two sessions; a visitor who stays quiet for 25 minutes inside one window is still one session.
  • Uniqueness resets at midnight UTC. The salt changes every day, so the same person on two days is two visitors and two sessions, never linked.
  • Sessions are never stored on the device. They exist only as the Session ID column of your raw CSV export, which is a per-day pseudonym.

Top Pages, Entry Pages and Exit Pages

The Top pages card on your dashboard has three views: All pages, Entry pages and Exit pages. Each view has its own CSV export.

  • URL grouping. A page is its path, for example /pricing. The tracker reports the path only: never the domain, the query string (?utm_source=news) or the fragment (#section), so two visits to /pricing that differ only in their query string are the same page and a token or an e-mail address in a link never reaches your reports. A path posted to the collect endpoint by hand has its query string and fragment cut when it is stored, so every view groups it as the same page; a hand-posted path stored before that change keeps its query string in All pages, while Entry and exit pages cut it when they are read. Entry and exit pages also report a path that does not start with a single /, is longer than 200 characters or contains a control character as __redacted_path.
  • All pages ranks paths by pageviews. The count is every pageview of that path, and Visitors is the number of distinct daily visitors who viewed it.
  • Entry pages and Exit pages read whole sessions, as defined above: the entry page of a session is the path of its first pageview and the exit page the path of its last one, in time order. A one-page session has the same entry and exit page. Each session is counted once, so the count of an entry or exit row is the number of sessions that started or ended there, and the rows add up to the number of sessions in the period (the dashboard lists the first 100 rows, the CSV the first 500). Visitors is the distinct visitors behind those sessions.
  • Denominators. The percentage change compares a row with the same row in the previous period of equal length. Klar shows counts, not shares, so there is no hidden denominator: divide a row by the sum of the rows to get its share of all sessions. The bounce rate stays sessions with one pageview ÷ all sessions.
  • Sessions cut by the period. A session is its pageviews inside the selected period. A visit that straddles the start or the end of the period enters or exits at the edge of the period.
  • Filters. Entry and exit pages are computed on the pageviews that match your filters, so with a filter on a page, the entry page of a session is its first matching pageview.
  • Imported history. Data imported from another analytics tool has no session order, so Entry pages and Exit pages count only the visits Klar collected. The dashboard says so on a site that has imports.
  • Aggregate queries. The same rules apply to the entry_path and exit_path dimensions of the metrics query layer, which also applies its minimum-audience threshold to every grouped result.

Bounce Rate and Average Visit

Both are calculated for the site and period you have selected, and both read whole sessions: a session is included when any of its pageviews matches your filters, and then all of its pageviews count.

  • Bounce rate = sessions with exactly one pageview ÷ all sessions, as a percentage. Custom events do not count as a second view, so a visitor who views one page and clicks a tracked button still bounced.
  • Avg. visit = the average time on page, in seconds, over the pageviews that have a recorded duration. A pageview with no recorded duration is left out of the average instead of counting as zero. The figure is per pageview, not the span between a session's first and last view, and each value is capped at 30 minutes.
  • A period with no sessions shows 0% and 0s rather than a blank.

The Last Page of a Visit

Klar measures engaged time only: the clock runs while the tab is visible and stops while it is hidden. A page's time is sent when the visitor leaves it or switches away from the tab, as a small beacon.

  • No beacon, no duration. If the browser is killed, the phone goes to sleep or the connection drops before the beacon is sent, that pageview has no duration and is excluded from Avg. visit. This hits the last page of a visit most often, because nothing after it prompts a second chance.
  • A one-page visit can still have a duration. Duration and bounce are independent: a bounced session is a session with one view, whether or not its time was recorded.
  • A visit that crosses :00 or :30. The duration beacon is matched to the pageview in its own 30-minute window. A page left open across the boundary reports into the next window, where it is stored as an extra pageview with only a duration.

Real-time Visitors

The Real-time visitors card sits at the top of the Dashboard overview. It polls; it is not a live stream.

  • Freshness target: 30 seconds. The card asks for fresh numbers every 30 seconds and the server answers from the database with no caching, so a pageview that has been collected shows up on the next refresh, 30 seconds later at most. If a refresh fails, or the last good answer is older than 90 seconds, the card says Stale and shows the time of the last good update.
  • Active visitors = distinct sessions with at least one pageview in the last 30 minutes. It is a count of sessions, so a visitor who crosses a :00 or :30 boundary inside that window can count twice.
  • Pageviews in the last 30 minutes = every pageview recorded in the same window. It is always at least as large as the active visitor count. Custom events and goal completions are not pageviews and are not included.
  • The card follows the site selector: with one site selected it shows that site, otherwise the sum over every site you can see.