-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heart beat should count only the time that was actively spent on a page #9540
Comments
we expierience this problem when testing for #9504 too.
hmm do we need to send a time/duration? Couldn't one only use the information that there was no ping or action in the meantime
within statistics? |
We might be able to calculate it server side but not really since the interval will be configurable at some point in the tracker. We need to see once someone actually starts working on it. Re mouse see #9542 (comment) |
Actually we could use it on top within an iframe maybe to see if window had focus but not sure if we should since it can make it quite slow to listen to it. Idea could be to listen to all mouse movements and scroll events. As soon as it was fired once, set |
maybe it could help to send ping period setting once when loading the page. |
very welcomed improvement, hope this ticket will get some attention in the near future.. I was very happy when heartbeat ping was introduced, but I noticed immediately that the accuracy was not that good, for the very reasons presented here by tsteur... but still, "not that accurate" is way better than nothing at all, so for now I am happy with what I can get :D |
So far, whenever we send a ping request from the heart beat feature, we set the
log_visit.visit_total_time
by calculatingcurrent timestamp - timestamp of first action
. The time spent on the last action is calculated by calculatingtimestamp of last ping request
-timestamp of last action creation
.This means we actually do not track how long a visitor spent actively on the page.
For example you open a new page in a new tab, 29 minutes later a visitor actually opens this tab, we send a ping request and we calculate a time spent on page of 29 minutes even though it is actually only a few seconds. On the contrary if a user opens the tab
30.01
minutes after the last action was tracked we would say there was actually0 seconds
spent on this tab because the pause between the last action and the ping request was > 30 minutes because it would otherwise create a new visit.Another example: You're browsing on a page for 2 minutes and then work in another window. So far Piwik would correctly report "2 minutes". Now the user comes back after 29 minutes, we would send a ping request and Piwik reports "31 minutes" spent on this page even though it would be still only 2 minutes. If the user came back to this tab after 30 minutes the 2 minutes that were reported initially would remain which is a bit random.
Ideally, we would maybe sent for how long a user was actually active. This could be done by calculating the time actively spent on the page in JavaScript and eg by sending a request like
ping=10
for "user spent 10 seconds on this page".I presume different users might expect different behaviour. The current implementation can lead to quite random numbers depending on how a user navigates through tabs.
The text was updated successfully, but these errors were encountered: