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.7k stars 2.62k forks source link

Visits per number of pages mistake when matomo HeartBeatTimer with value 1 #20473

Open matomoto opened 1 year ago

matomoto commented 1 year ago

4.13.3 JavaScript Tracking Code (default mode) activated:

By one-pager websites, there are page visits greater than 1 in the widget "Visits per number of pages". The one-pagers have many outgoing links with target="_blank". The page visits are always the same page (not imprint or similar). The one-pager are without URL-anker or URL querystrings.

More Infos about this in the matomo forum: https://forum.matomo.org/t/visits-per-number-of-pages-mistake/49933

bx80 commented 1 year ago

Hi @matomoto, thanks for reporting this.

Would it be correct to summarize that for single page sites using the Matomo Heartbeat timer, viewing a page, switching to a different browser tab and then back will cause another page view to be tracked?

matomoto commented 1 year ago

The thing is not the one-pager, because on one-pager it is easy to observed it, because the one-pager have only one page. It will be the same with multi-page websites, but it is not so easy to observe it on multi-page websites. Otherwise, I agree with your statement.

michalkleiner commented 1 year ago

Hi @matomoto,

thinking about the issue at hand here, is it possible to confirm that when you switch the tabs that there's no actual page load? Some browser extensions and sometimes even browsers themselves try to be smart and put tabs in sleep to save memory and then reload the page when the user switches back to it. Not sure about how long between the tab switches, if there's a new duration recorded when flicking through tabs within a few seconds, a new visit certainly shouldn't be recorded unless something forces a page reload.

Is that a likely scenario you can confirm/reject? Thanks!