I have a Chrome extension which triggers a pop-up window when the icon is clicked in the browser bar, and closes when a user clicks outside of the window. I want to track the amount of time that the window stays open before the user clicks to close it. Is there a way to achieve this?
Best answer by willyv
You can implement mixpanel.time_event() which will return the time between the start and end event. So you could call a "Viewed Pop-up" event at the start of a session, and then call a "Click exit pop-up" event when the session ends. Then use mixpanel.time_event to return the time between the start and end event. When you call the "Click exit pop-up" event, an event property, 'Duration' appends to the "Click exit pop-up" event with the elapsed time in seconds as the property value.
As a note, I've experienced sometimes users will go on my page and leave a page open for long period of time(i think they forget), this can results with skewed data.