Solved

Is there a way to track duration of pop-up window being open?

  • 24 October 2019
  • 2 replies
  • 442 views

Badge
  • Frequent Contributor
  • 5 replies

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?


icon

Best answer by willyv 29 October 2019, 22:48

@Elton You could track a duration of your pop-up window event by using the mixpanel.time_event call.

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.



View original

2 replies

Userlevel 3
Badge

@Elton You could track a duration of your pop-up window event by using the mixpanel.time_event call.

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.


Badge

Wow, @willyv this is really helpful! Thanks! I'll give this a go.


Reply


Mixpanel