Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
API Reference

Session

Get metadata for the current session. - Deprecated.

🚧

Deprecation warning

This API is deprecated and was removed in March 2018. You can use the session_index field if you are looking to query for events from a particular session.

Syntax

session = window["optimizely"].get("session");

Parameters

Parameter and Type

Child Attribute

Description

session string

N/A

The argument indicating to get session information. Required.

Return value

Parameter and Type

Child Attribute

Description

SessionObject

N/A

The object containing session information.

lastSessionTimestamp
integer

Child attribute of type SessionObject

A timestamp of when the last session was started.

sessionId
string

Child attribute of type SessionObject

A unique ID for this session. Optimizely Web Experimentation will use this unique ID to calculate results.

  • *

Child attribute of type SessionObject

This object can contain project- or environment-specific properties that are not predefined.

Example Call

session = window["optimizely"].get("session");

Example Return Value

{
  "lastSessionTimestamp": 1476765927360,
  "sessionId": "b6d3c104-2057-408e-acfe-8ca554713d8f"
}