faro-web-sdk
faro-web-sdk copied to clipboard
Better support session related business metrics
Description
Currently it's not straight forward to get business related session metrics like duration or bounce rates.
Faro's session manager currently doesn't send a session_end event.
This is because Faro can't know when a session conceptually ends.
Is it after a user logs out of a page or after a certain timespan etc.
It may be still useful for customers if Faro provides an easy to use set of functions to clear or end a session.
Furthermore it cab provide a session_end event which can be sent manually to have an option to track business metrics like session length or drop rates.
This is an easy option to get started. In the long term this should be made easier
Proposed solution
- Provide convenience function for ending a session and sending a respective event.
- Additionally we can think about adding the session_start timestamp to the session meta so we always can derive the current session duration.
Alternatively we can only add the session duration to the respective session lifecylcle event. Whole duration e. g. can be calculated by
lastSessionLifecycleEvent.duration + lastEvent.timestamp - lastSessionLifecycleEvent.timestamp. This would save a good chunk of redundant meta data