jitsu
jitsu copied to clipboard
Session Support for Pixel/SDK
Problem
Currently, SDK sends page view events when the user loads a page/website, but one key information missing is sessions. Without sessions, we are missing to find out how long did the user use the web application before they closed the web page. What most of the applications are doing is they send a session_started
event when the Dom is loaded and when the user exit the page, an event session_ended
is sent.

Solution
Proposed solution: architecture, implementation details etc
- Provide an option on Pixel/SDK and make this it as an optional field:
isSessionEnabled
. By default the option is set to False. - If the option
isSessionEnabled
is enabled, send asession_started
event along with Page View. When the user is closing the tab,session_ended
event can be triggered.
@azhard4int we'll take a look. Probably that's something we can release mid-October.
However, I don't think session
is a good description of this feature. Usually, sessions are a sequence of different page views that happens in a short time window (btw, we have DBT sessionazation package).
If we stick with following:
- Add
page_left
event ifshouldTrackPageLeft
is set to true - Keep original
page_view
- Add
secondsOnPage
topage_left
event
Will it solve your problem?
@vklimontovich Thanks for getting back.
Yes, page_left event would be good enough to achieve the above functionality.
@vklimontovich Is there any time line for page_left
event, when it will be shipped?
Hi @azhard4int! Not this month :( Maybe in December. Maybe it would make sense to implement that on your frontend? I believe this package will do the job: https://github.com/jasonzissman/TimeMe.js/
You can use Jitsu to send page_left/seconds_on_the_page
P. S. unfortunately, we can't use the same lib with Jitsu tracker due to bundle size constraints, and we'd need to implement our own version)
@vklimontovich We are building our SaaS on top of Jitsu, if we were using for our own company/product, we could go with the option that you suggested.
So, we'll wait for this to be added in December or so.