A Session is a simple Data Object that has a known ID as well as a
updated_at timestamps. Sessions make it easier to analyze and group Events sent within a fixed period of time by an individual user.
Creating a Session
session_id present on the Event object AND if there is no
fsid cookie present in the request sent from firstparty.js, a browser, or any HTTP client.
Sessions are not automatically expired by Firstparty. Firstparty.js will maintain a
fsid Session cookie, which will expire after the browser session ends. This behavior may vary from browser to browser, but typically involves ending the session when the browser window is closed.
Attaching Events to a Session
Events will automatically be associated with a Session if, when the Event is collected by Firstparty, one of the following situations are true:
- The Event payload has a valid Session ID set on the
- The HTTP request sending the Event to Firstparty has a valid Session ID set on the
Tracking Sessions Across Sources
You may wish to associate Events sent from different Sources with the same Session. This is useful when you want to associate an Event that is generated from a web server via an HTTP Source with an in-progress Session where a user is generating Events in a browser via Firstparty.js.
Send an existing Session ID as the
session_id parameter on the Event, and Firstparty will automatically associate the newly collected Event with the existing Session, even if the Session and Event were created from different sources.