Web session

Explore what information is available for web sessions.

This type represents a summary of a user’s activity in a web application, providing valuable insight into user behavior and engagement.

It also tells you which audiences the user has matched and which experiences and experiments have affected them so far, so you can take what the user has already seen into account.

In addition to the properties listed below, the web session supports additional properties called custom attributes.

These attributes are useful if you want to store additional information that is only relevant during the session. For example, you could set a plan attribute to store the plan the user selected and use it later in the session for personalization purposes.

Properties

These are the available properties:

start

The start time of the session, corresponding to the time of the first interaction in the session.

end

The end time of the session, corresponding to the time of the last interaction in the session.

duration

The duration of the session until the last interaction. It is calculated as the difference between the start time and the end time.

landingPage

The URL of the page the user landed on in the current session. It is not available if the starting page is unknown.

referrer

The URL of the page that linked to the page the user landed on in the current session. It is not available if the initial page is accessed directly.

stats

The aggregate statistics of the session.

audiences
list<Audience>

The list of audiences from the experiences that impacted the user in the current session. It is empty if no experience impacted the user so far.

experiences
list<Experience>

The list of experiences that impacted the user in the current session. It is empty if no experience impacted the user so far.

experiments
list<Experiment>

The list of experiments and variants assigned to the user in the current session. It is empty if no experiment was assigned to the user so far.

<attribute>

A custom attribute, where /*<attribute>*/ is the name of the attribute.

You can access any custom attribute just like any other property. For example, if you have defined a custom property named plan, you can access it like this:

session's plan

If a custom attribute has the same name as a predefined one, it takes precedence and hides the predefined attribute without overwriting it. Removing the custom attribute exposes the predefined one again.