Hello everyone! I need help with a topic: I need to identify the time a user spends on our landing pages. I saw in this article https://muffaddal-qutbuddin.medium.com/track-average-time-on-page-in-mixpanel-c80cbb52be99 that we can use the mixpanel.time_event method, but I have a question: Can I do this without necessarily triggering the page exit event? I ask because I don't want to generate another high-volume event.
you can track an initial event on the page and then use funnels to calculate average time between pages., We do have a track_pageview option that would do this automatically: https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript#tracking-page-views You will be able to build a funnel with step1 one page and step2 another page, and it will give you the average time between both
That's one way, but how could I measure from people who only have one pageview?
then it's not possible, you need to rely on 2 events to calculate the difference between first event and second event
that is what time_event() helps with, it stores the timestamp when you call time_event and adds the duration when you actually track it, so it's giving you duration between 2 timestamps
on mobile, you can detect when a user leaves your app/screen so it's easier, and our sdks track duration using App Session event so you know exactly the time spent by the user on the app
on web, it's more challenging, you would need to find a way to detect when the user leaves the page and track a second event or use time_event()
you could use beforeunload in JS but that is not reliable
I can track when the user leaves the page, the point is that I didn't want to have another event of this type being triggered, as it will be an event with a high volume, impacting contract values. Anyway, I'll evaluate the possibilities, thanks for the clarification!