Core Metrics, Sessions & Live View
Learn how visitors, sessions, bounce rate, and active dwell time work, plus how TrimStats calculates core KPIs and click-to-filter segments.
How does TrimStats calculate sessions, live visitors, bounce rate, and dwell time?
TrimStats counts live visitors over a rolling 300-second (5-minute) window, groups visits into sessions using a 30-minute sliding inactivity timeout, calculates active dwell strictly while browser tabs are visible, and defines bounce rate as <= 1 pageview AND < 10 seconds of active dwell.
Understanding visitors, sessions, and bounce rate
Web analytics groups raw browser hits into three layers: pageviews, sessions, and visitors. Understanding how these differ prevents misreading traffic reports.
- Visitor vs Session vs Pageview: Suppose one reader opens your blog at 9:00 AM, reads two posts, closes the tab, and returns at 2:00 PM to check
/pricing. That generates 1 unique visitor, 2 sessions (separated by more than 30 minutes of inactivity), and 3 pageviews. - Why traditional bounce rate penalizes good content: Legacy tools mark any single-page visit as a bounce, even if someone spent 5 minutes reading your entire tutorial. TrimStats only counts a session as a bounce when it has
<= 1pageview and less than 10 seconds of active visible time. - Why active visit time beats wall-clock time: Leaving a browser tab open in the background for 40 minutes inflates averages in naive trackers. TrimStats pauses its timer whenever the tab hides so Avg. Active Time reflects real attention.
How core KPIs are calculated
Every metric in the site Overview dashboard is computed directly in ClickHouse and compared automatically against the immediately preceding window of the same length.
| Metric | Formula / Rule | Notes |
|---|---|---|
| Live visitors | Distinct visitors active within the last 5 minutes (300 s) | Served in sub-millisecond time from Valkey/Redis sorted sets (live:{siteId}). |
| Visitors | Distinct visitor_id values (uniqCombined64) with pageview activity in the date range | Scoped per UTC day in cookie-less mode; persistent across days in first-party or identified mode. |
| Sessions | Distinct session_id UUIDs created with a 30-minute sliding inactivity timeout | Each incoming event refreshes the 30-minute session TTL automatically. |
| Bounce rate | Percentage of sessions with pageviews <= 1 and active duration_ms < 10,000 (10 seconds) | Visitors who read a single blog post for more than 10 seconds are not penalized as bounces. |
| Visit time (Avg. duration) | sum(active_duration_ms) / sessions | Uses visibility-aware active time only; hidden background tabs do not inflate visit time. |
| Views / session | pageviews / sessions rounded to 2 decimal places | Measures depth of navigation across multi-page sessions. |
Breakdowns & click-to-filter segments
Aggregate site totals hide important differences between audiences. Segmentation slices every KPI and table down to a specific subset of traffic, such as visitors arriving from google.com or mobile readers landing on /pricing.
The Overview report aggregates the top 25 items per dimension in parallel: Top pages, Entry pages, Exit pages, Referrers, UTM sources, UTM campaigns, Countries, Devices, Browsers, Operating systems, and Custom / outbound / download events.
google.com in Acquisition adds an active filter pill at the top and recalculates all KPIs and breakdown cards for search visitors alone.Click any row in a breakdown card (such as a specific country, referrer, UTM campaign, device type, browser, OS, or pathname) to filter the entire Overview chart, KPIs, and all other breakdown tables by that segment.
Visitors directory & chronological timelines
Open the Visitors tab for any site to inspect live and recently active visitors, search by external_user_id, visitor_id, or visited pathname, and click any visitor to open their chronological journey panel.
- Displays each visitor identity mode badge (
cookieless,first_party, oridentified), location, device/browser/OS, first referrer, and initial UTM tags. - Merges pageviews (with matched per-page active dwell duration), custom events with JSON properties, outbound clicks, downloads, scroll milestones, UI friction events, and attributed revenue transactions into one chronological stream.
- Supports up to 730 days of visitor lookback (default 90 days) when persistent identity is active.
Common technical questions
Why is TrimStats bounce rate lower and more accurate than legacy analytics on blogs?
How many rows appear in each TrimStats dashboard breakdown table?
Related guides
What TrimStats captures automatically out of the box, plus how referrers, Direct traffic ("dark social"), and UTM campaign tags work.
Choose per site between zero-storage cookie-less analytics and persistent first-party visitor IDs, plus optional logged-in user identification.
Learn how conversion goals and conversion rate work, configure exact/wildcard paths or custom events, and monitor automatic conversion dips.