Mixpanel Community Icon

Validating Mixpanel Session Duration: API Data Pull Approach Explained

·
·

Has anyone here ever pulled raw data directly from Mixpanel via API to validate session duration ($duration_s)? I've been advised by the Mixpanel team to do the following: For 30 min sessions:

  1. 1.

    Group events by user (distinct_id)

  2. 2.

    Order events by timestamp

  3. 3.

    Calculate the time difference between consecutive events

  4. 4.

    Mark events as $session_end where the time difference to the next event exceeds 30 minutes or where it's the last event of the day

The approach seems logical but I'm curious if anyone's done this before and if it worked for them given it'll require non trivial engineering effort. Thanks all!