Is there a way track the focus on tab with Javascript?

前端 未结 3 2171
庸人自扰
庸人自扰 2020-12-14 23:01
  • We need to track the EFFECTIVE time on site of our users
  • Most users, when they\'re done, leave the tab open and move to another tab
  • Time on site it\'
3条回答
  •  醉梦人生
    2020-12-14 23:21

    Which tab you are talking about? Is it your Nav/menu tab or Browser tab. I feel, you mean browser tab! I think it is not possible accurately. But what if you track few events like mousemove, focus etc and then fire an event that same some data (counter) on server. When user is on your page then he will do something something like move mouse, click somewhere etc. So difference in first page load and last event can tell the usage stat.

提交回复
热议问题