A session refers to a specific period of time during which a user interacts with a website or application. This concept
is essential for analyzing user engagement, understanding user journeys, and providing personalized experiences.
When a user visits a website or application integrated with Tracardi, a unique session ID is assigned to them. This ID
is typically stored in a cookie on the user's device, or in device memory. The session ID enables Tracardi to recognize
and associate the user's actions and events within a specific session.
The Tracardi system calculates visits based on the continuity of the session ID. If the session ID remains the same, it
suggests that the user is still actively engaging with the website or application. Consequently, Tracardi considers this
as part of the same visit. However, if the user closes their browser, or when the session expires, the session ID gets
deleted. A new session begins when the user revisits the site.
Through tracking sessions, Tracardi can offer insights into various aspects of user behavior. For instance, it can
calculate session duration, page views per session, entry and exit points, and conversion rates.
For example, suppose there is a website integrated with Tracardi. When a user visits this site, a session begins, and
the user gets a unique session ID, stored in a cookie on their device. The activities that the user conducts on the
website, like viewing different pages, adding items to the cart, purchasing an item, etc., are tracked under this
session ID. If the user closes the site and comes back later, a new session with a new ID starts.
This session tracking aids in understanding the user behavior during each visit, providing a personalized user
experience, and so forth.
Session Object Documentation
The Session object captures details about a user session, including metadata, profile information, device details, application data, and more. Below is a description of its structure and data fields with examples presented in a tabular format.
Structure and Fields
Field
Type
Description
Example
id
String
Unique identifier for the session.
"3dbd1ac1-6a28-463a-a3c6-05593760831a"
Metadata
Field
Type
Description
Example
metadata
Object
Metadata about the session.
├── time
Object
Timestamps and time-related details.
│ ├── insert
Date
Timestamp when the session was inserted (at origin).
"2024-05-30T07:44:23.243135Z"
│ ├── create
Date (nullable)
Timestamp when the session was created.
null
│ ├── update
Date (nullable)
Timestamp when the session was last updated.
null
│ ├── timestamp
Float
Unix timestamp of the session.
1717055063.243177
│ ├── duration
Integer
Duration of the session in seconds.
0
│ ├── weekday
Integer
Weekday of the session (0 = Sunday, 6 = Saturday).