umami icon indicating copy to clipboard operation
umami copied to clipboard

Page Visit time not correct

Open chatRG opened this issue 2 years ago • 6 comments

Expected that using navigator beacon API will fix the page visit time. When visiting a page and navigating to some other tab is not triggering the collect API endpoint for tracking time. It tracks time only after a page refresh which is not right as it adds a page view count unnecessarily.

How is the page visit time actually calculated? Was expecting the feature to be something like this.

chatRG avatar Mar 21 '22 12:03 chatRG

As I understand it, only event tracking has been migrated to use the beacon api so far while page views still use xhr. This is currently being tracked in #570.

Sammy-T avatar Mar 21 '22 23:03 Sammy-T

That's right, next release will tackle page visit time. It's tricky because I need to decide whether to make a database schema change or find another way around it.

mikecao avatar Mar 22 '22 02:03 mikecao

Is there any plan to prioritize this? As for proper analytics, the page visit time is pretty important.

Maybe it is possible to use the library I mentioned in the first comment.

chatRG avatar Apr 08 '22 11:04 chatRG

I've explored tracking the visit time to see if I could contribute on this. And it isn't particularly difficult to determine the duration on the client-side. But, similar to what @mikecao had mentioned, the database is where I hit a wall. I couldn't figure out how to non-destructively update the database schema and additionally keep the multiple database support.

Sammy-T avatar Apr 08 '22 21:04 Sammy-T

I have a similar use case: users come to our site -> go to stream page -> sit on page for x minutes/hours -> exit

This makes our realtime stats, current stats, and session times all off

Would tracking an event with javascript on an interval (say, 3 minutes) keep this data up-to-date? Or would that possibly work for the realtime and current stats, but not session time?

joeyscarim avatar Jul 21 '22 14:07 joeyscarim

I feel like this is a very important metric for a lot of users, and in its current form fundamentally flawed:

  1. with times only tracked between hits, last page visit duration and single-page visitors are not tracked at all
  2. visit times are polluted by inactive time

are there any plans for working on this? I feel like it deserves a lot more attention, since the current metric is not accurate at all.

changethe avatar Sep 12 '22 12:09 changethe

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Aug 19 '23 01:08 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Aug 26 '23 01:08 github-actions[bot]