Session
In Tracardi, a session is a type of data that is often associated with a visit to a website or application. It is a period during which a user actively interacts with the system or application.
How tracardi knows when the session ends?
Sessions are tracked to understand user behavior and engagement over a period of time. Here's how Tracardi detects and manages session changes:
-
Session Initialization:
- When a user visits a website or application integrated with Tracardi, a unique session ID is assigned to the user. This session ID is typically stored in a cookie on the user's device or in device memory .
-
Session Continuity:
- As long as the session ID remains the same, Tracardi considers the user to be part of the same session. This means that all user interactions and events are grouped under this session ID, indicating continuous activity.
-
Session Expiration:
- If the user closes their browser or the session expires due to inactivity, the session ID is deleted. When the user revisits the site, a new session ID is generated, indicating the start of a new session .
-
Session ID Changes:
- The session ID changes when certain conditions are met, such as the user closing the browser, the session timing out, or the session being explicitly invalidated. Tracardi detects these changes and increments the visit count in the user profile to reflect a new session or visit .
-
Debug Mode Considerations:
- In debug mode, the session ID remains constant for every simulated event, which can affect the expected behavior. This mode is designed to simplify the debugging process by providing consistency and predictability, but it's important to be aware of its impact on session-dependent logic when transitioning to live deployment .
Summary
As long as the session remains unchanged, the visit is considered ongoing. The session ID is set when data is sent to Tracardi, and it is typically under the control of the client program.
Session Data
Session can contain data. Sessions are used to track user interactions over a period of time, and they can store various types of information related to these interactions. Session draws data from the context of event track payload.
Components of a Session
- Session ID: Each session has a unique identifier that distinguishes it from other sessions.
- User Profile: Sessions are linked to user profiles, which contain detailed information about the user. This linkage helps in associating session activities with the user’s overall behavior and characteristics.
- Start Time: Sessions have defined start time, and a sequence of events.
- Events: Sessions contain events that record user interactions and activities during the session. Events can include page views, clicks, form submissions, and other user actions.
- Context Data: Sessions often contain data about the context in which an event was launched, such as the type of device, operating system, or other characteristics of the user's environment.
Importance of Sessions
- User Tracking: Sessions help in tracking user interactions over a period, providing insights into user behavior and engagement.
- Behavior Analysis: By analyzing session data, you can understand user behavior patterns, such as how long users stay on your site, what actions they perform, and what content they engage with.
- Marketing and Analytics: Sessions provide valuable data for marketing campaigns origin, helping you measure the effectiveness of your strategies and optimize user engagement.
Session Management
In Tracardi, sessions are automatically created and managed. Here’s how session management typically works:
- Session Initiation: A session starts when a user begins interacting with your website or application. This can be triggered by various events, such as loading a page or performing an action.
- Event Recording: Throughout the session, events are recorded to capture user interactions. These events are associated with the session ID.
- Session Termination: A session ends when the user becomes inactive for a certain period or explicitly logs out.
The session’s end time is recorded, and the session is then closed which is indicated with event
Visit Ended
.