matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.91k stars 2.65k forks source link

Tracking userId session with multiply tabs records only last opened tab #13302

Open olegandreyev opened 6 years ago

olegandreyev commented 6 years ago

Hi Matomo team. I have an issue related to use case when the same user opens multiple tabs and heartbeat mode is enabled. The main problem is when I open new tab I call trackPageView. So new item will show on the tracker dashboard in this session row (same user - same session - but new page view) . BUT when I focus previous tab it sends ping request to analytic server where the time is being added not to current tab (page view) but to the last opened one. So after that even if I close last opened tab and change focus between two previous tabs. The time will be assumed for the last opened tab (page view) which does not exist already)

So I expect behavior that the heartbeat will update a previous page view time and not only the last one :) What do you think about it? Maybe I do something wrong

tsteur commented 6 years ago

Just FYI: that's a known issue. Not sure if there is an actual issue though. Not sure if it will be worked on too soon re possible performance problems when updating the correct action.

KarthikRaja1388 commented 8 months ago

We have a cloud customer reported the same issue. Do we have any update on this?

Customer's request: Recently we have been struggling with the precision of the "Time on page" tracking data. We thought that enabling the Matomo "heartbeat" feature as described here would track visit times correctly even if users switch between tabs: https://developer.matomo.org/guides/tracking-javascript-guide#accurately-measure-the-time-spent-on-each-page

But that doesn't seem to be the case - when opening multiple tabs, the time spent on all tabs is effectively added to the last active tab. This seems to be the same issue as the one described in this bug report from 2018: https://github.com/matomo-org/matomo/issues/13302

Do you know if there are plans for making these metrics more precise? It would be quite important for us since quite a few users are using tabs, and the time spent on a document is usually a good indicator for this document being relevant to the user, and therefore for further improving the search feature.

Chardonneaur commented 6 months ago

Following up @KarthikRaja1388 comment, I am confirming you that this request is still active and that a new demand has been done today.