Understand how visitor sessions are defined, tracked, and measured.
A session in Optimize is a period of continuous activity by a visitor on your site. It starts when a visitor loads a page with the Optimize snippet and ends after a period of inactivity or after reaching a maximum duration. Understanding session behavior helps you interpret metrics like conversions and engagement more accurately.
When does a session start and end?
A session begins when a visitor views any page that includes the Optimize snippet. This action creates a unique sessionId in localStorage with a timestamp. The session continues as long as the visitor keeps browsing pages with the snippet.
A session ends if:
- There’s 30 minutes of inactivity — i.e., no page with the snippet is viewed during that time
- The session reaches a total of 24 hours of activity, regardless of break length
The session timestamp is refreshed whenever the visitor views another page that includes the snippet. This doesn’t require interacting with the page or triggering a variation.
What happens if the browser or tab is closed?
Closing the browser or tab doesn’t immediately end the session. If the visitor returns within 30 minutes, their session resumes — the timestamp gets refreshed and the session continues.
If they return after 30 minutes or more, a new session is started.
Session maximum duration
A single session can last up to 24 hours. For example, if a visitor spends the day exploring your site — hitting pages with the snippet and taking breaks of less than 30 minutes — that’s still a single session. After 24 hours of active time, the session automatically expires.
Why session data may differ from other tools
Different analytics platforms define and track sessions in different ways, which can lead to discrepancies in metrics like total sessions, conversions per session, or bounce rate. Optimize uses a consistent and simple definition of a session to keep optimization data focused and reliable.
Here’s how Optimize session tracking might differ from other tools:
- Session continuity — Optimize sessions remain active unless the visitor is inactive for 30+ minutes or hits a 24-hour session limit. Other platforms may end sessions at midnight or when campaign sources change.
- Snippet coverage — only pages with the Optimize snippet are counted. If a visitor navigates between snippet and non-snippet pages, this may fragment session tracking.
- Cross-tool variance — other platforms may use different logic for session start/end triggers or consider additional factors like attribution, page visibility, or engagement thresholds.