Solved

Sessionising Raw Export API Events Data


I’m pulling all events data from mixpanel each day so I can do analysis on it in SQL. I would like to be able to convert that data into sessions but can’t find anything outside a vague description of calculating on the frontend in mixpanel.

 

How would I go about working out sessions from the raw events data?

icon

Best answer by linyee 19 May 2022, 05:42

View original

2 replies

Badge +1

It would be a product gap to export the Session Start and Session End events. These events are what we call “virtual events” calculated on the front-end. This allows you the flexibility to change your Session Settings at any time without redoing your implementation. Those changes will be reflected in the Session information for all events, including historical events. As a consequence, the Sessions event data cannot be exported from the backend or an API like normal events can.

While I’m not sure your exact use case, a possible workaround is to export these events through an Insights report or insights API.

Hi, thank you for your response. Could you tell me what the front-end calculation is so I can replicate it and not have to use a clunky work-around?

 

Edit: Sorry, ignore the question above. I found the answer here: https://help.mixpanel.com/hc/en-us/articles/115004695223-Track-Sessions

 

Thanks for your help

Reply