Overview

Session endpoints provide access to user session data, allowing you to analyze user behavior, session duration, and user journeys across your website.

Session Endpoints

Usage Examples

Get Recent Sessions

GET /api/websites/abc123/sessions?limit=50&offset=0

Get Sessions from Specific Browser

GET /api/websites/abc123/sessions?filter=browser:Chrome&limit=100

Get Session Statistics by Device

GET /api/websites/abc123/sessions/stats?groupBy=device

Get Detailed Session Information

GET /api/websites/abc123/sessions/sess123456

Get Session Activity Timeline

GET /api/websites/abc123/sessions/sess123456/activity

Get Sessions with Custom Properties

GET /api/websites/abc123/session-data/properties?property=email

Get Unique Plan Values

GET /api/websites/abc123/session-data/values?property=plan

Session Filtering

You can filter sessions using various criteria:

Filter by Technology

# Filter by browser
GET /api/websites/abc123/sessions?filter=browser:Chrome

# Filter by operating system
GET /api/websites/abc123/sessions?filter=os:Windows

# Filter by device type
GET /api/websites/abc123/sessions?filter=device:desktop

Filter by Geography

# Filter by country
GET /api/websites/abc123/sessions?filter=country:US

Filter by Time Range

# Get sessions from last 7 days
GET /api/websites/abc123/sessions?startDate=2023-05-08&endDate=2023-05-15

Session Metrics

Key Session Metrics

  • Duration: Total time spent in the session
  • Page Views: Number of pages viewed
  • Events: Total number of events triggered
  • Bounce Rate: Percentage of single-page sessions
  • Pages per Session: Average pages viewed per session

Session Quality Indicators

  • Engagement Score: Based on duration and interactions
  • Conversion: Whether the session resulted in a conversion event
  • Return Visitor: Whether this is a returning visitor

Common Session Analysis Patterns

User Journey Analysis

# Get session details to understand user path
GET /api/websites/abc123/sessions/sess123/activity

Cohort Analysis

# Get sessions by date range for cohort analysis
GET /api/websites/abc123/sessions?startDate=2023-05-01&endDate=2023-05-07

User Segmentation

# Get sessions with specific properties for segmentation
GET /api/websites/abc123/session-data/properties?property=user_type&value=premium

Performance Analysis

# Get session statistics to analyze performance
GET /api/websites/abc123/sessions/stats?groupBy=browser