Using JavaScript I want to track the user activity (active or inactive) on my website and I'd like to store this info in my database. I decided to use the activity-detector library which does indeed track the user activity, however if the user has the same webpage opened in 2 tabs then I'm going to end up with inaccurate information so how would I take into account the fact that the user can open the same webpage in 2 tabs?
Track user activity while taking into account when the user opens in a new tab
498 views Asked by Daniel_Kamel At
1
With the combination of
localStorageandself.window.nameyou can determine whether other windows/tabs are being used by the same user.