I would like to measure how much time a user spends on my site. This is necessary for the community site, where you can say: "User X spent 1397 minutes here."
After reading some documents about this, I know that there is no ideal way to achieve this. You cannot measure the exact time. But I'm looking for an approach that gives a good approximation.
How could you do this? My ideas: 1) Adding 30 seconds to the online time counter on every pageview. 2) On each page view, save the current time stamp. In the next view, add the difference between the saved time stamp and the current time stamp on the Internet time counter.
I use PHP and MySQL if that matters.
I hope you help me. Thanks in advance!
source
share