Sessions
Understand how user sessions are managed and tracked across your application.
Session Management
A session groups user activity within a time window. Sessions help you understand user engagement patterns.
Session Rules
| Rule | Description |
|---|---|
| Timeout | Session expires after 30 minutes of inactivity |
| UTM Reset | New UTM parameters in URL start a new session (web) |
| App Lifecycle | Session resumes when app returns to foreground (mobile) |
Automatic Session Tracking
The SDK automatically manages sessions - no manual intervention required.
The SDK automatically manages:
- sessionId: Unique identifier for the session
- pageNumberInSession: Sequential page count (1, 2, 3…)
- UTM parameters: Captured at session start
Sessions are stored in a cookie (alke_s) that expires after 30 minutes of inactivity.
// Session data is included automatically in every event
// No manual configuration needed
User ID
The user ID is a persistent identifier stored on the device, generated automatically on first SDK initialization.
- Stored in
alke_ucookie - 30-day expiration (renewed on each visit)
- Respects consent (cookie only set if consent granted)
UTM Parameters (Web)
Traffic source attribution is captured from URL parameters:
| Parameter | Description |
|---|---|
utm_source | Traffic source (google, newsletter) |
utm_medium | Marketing medium (cpc, email) |
utm_campaign | Campaign name |
utm_term | Paid keywords |
utm_content | Ad content variant |
https://example.com/page?utm_source=google&utm_medium=cpc&utm_campaign=spring_sale
When a user arrives with UTM parameters:
- A new session is started
- UTM values are stored for the session duration
- All pageviews in the session inherit these values
Consent
UTM parameters require consent for purposes 1, 7, and 9 (store/access, advertising performance, audience understanding).