Sessions
A session represents a continuous period of user activity on your site. Sessions are the foundation for engagement metrics like bounce rate, session duration, and pages per session.
What Is a Session
A session begins when a user first interacts with your site and ends after 30 minutes of inactivity. If the user returns after the timeout has elapsed, a new session is created. Sessions group related events together so you can understand user journeys as cohesive visits rather than isolated actions.
Session Lifecycle
Start
A session starts when:
- A user loads your site for the first time
- A user returns after the session timeout has elapsed (default: 30 minutes)
reset()is called, which forces a new session
When a session starts, the SDK sends a session_start event to the __analytics channel with referrer, UTM parameters, and device information.
Active
While the session is active, any user interaction (page view, click, custom event) resets the inactivity timer. The session remains open as long as the user continues interacting within the timeout window.
End
A session ends after 30 minutes with no user activity. There is no explicit "session end" event -- the server determines session boundaries based on the time gap between events.
Session Data
Each session contains the following data points:
| Field | Description |
|---|---|
| Session ID | A unique UUID identifying the session |
| Start time | Timestamp of the first event in the session |
| End time | Timestamp of the last activity in the session |
| Duration | Time between the first and last event |
| Event count | Total number of events recorded during the session |
| User ID | The identified user (if identify() was called during the session) |
| Browser | Browser name and version |
| OS | Operating system name and version |
| Device type | Desktop, mobile, or tablet |
| Country | Country resolved from IP geolocation |
| Region | Region or state |
| City | City |
| Pages visited | List of page paths viewed during the session |
Session Analytics
The Sessions page in the dashboard lets you explore sessions across your user base.
Session List
View all sessions with filtering options:
| Filter | Description |
|---|---|
| Date range | Select a time window |
| Environment | Separate production from staging or development |
| Country | Filter by geographic location |
| Browser | Filter by browser name |
| Device type | Filter by desktop, mobile, or tablet |
| User | Search sessions by user ID |
Session Detail
Click on any session to drill into its event timeline. The detail view shows every event that occurred during the session in chronological order, including:
- Event name and channel
- Timestamp
- Tags and metadata
- Page path
Session Metrics
| Metric | Description |
|---|---|
| Session duration distribution | Histogram showing how long sessions typically last |
| Events per session | Average number of events across sessions |
| Pages per session | Average number of distinct pages viewed |
Bounce Rate
A "bounced" session is one where the user viewed only a single page before leaving. Bounce rate measures the percentage of these single-page sessions.
Bounce Rate = (Bounced Sessions / Total Sessions) x 100A high bounce rate may indicate that users are not finding what they expect, or it may be normal for content like blog posts where a single page satisfies the visit. Interpret bounce rate in the context of your site's purpose.
Session Management in the SDK
The SDK provides methods to inspect and control sessions programmatically.
Get Session Info
const session = kitbase.getSession();
// => {
// id: 'sess_abc123',
// startedAt: 1705321800000,
// lastActivityAt: 1705323600000
// }Get Session ID
const sessionId = kitbase.getSessionId();
// => 'sess_abc123'Force a New Session
kitbase.reset();
// Ends the current session and starts a new one
// Also clears the user ID (if set via identify)