衡量网站上的在线时间 [英] Measuring online time on website

查看:104
本文介绍了衡量网站上的在线时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想衡量用户在我的网站上花费了多少时间.您需要在社区站点中说:用户X在这里花费了1397分钟."

I would like to measure how much time a user spends on my website. It's needed for a community site where you can say: "User X has been spending 1397 minutes here."

在阅读一些有关此的文档后,我知道没有完美的方法可以实现此目的.您无法测量确切的时间.但是我正在寻找一种可以很好地近似的方法.

After reading some documents about this, I know that there is no perfect way to achieve this. You can't measure the exact time. But I'm looking for an approach which gives a good approximation.

您怎么能做到这一点?我的想法: 1)在每个页面浏览量的在线时间计数器上增加30秒. 2)在每个页面视图上,保存当前时间戳.在下一个视图上,将保存的时间戳和当前时间戳之间的差添加到在线时间计数器.

How could you do this? My ideas: 1) Adding 30 seconds to the online time counter on every page view. 2) On every page view, save the current timestamp. On the next view, add the difference between the saved timestamp and the current timestamp to the online time counter.

如果这很重要,我会使用PHP和MySQL.

I use PHP and MySQL if this does matter.

希望您能帮助我.预先感谢!

I hope you can help me. Thanks in advance!

推荐答案

两个因素对您不利-

  1. 您只能收集时间点统计信息(页面浏览量),并且没有合理的方法来检测这些点之间发生的情况;

  1. You can only collect point-in-time statistics (page views), and there's no reasonable way to detect what happened between those points;

即使如此,您也要计算浏览器窗口时间,而不是用户时间;用户可以轻松地同时在多个浏览器实例上打开多个标签.

Even then, you'd be counting browser window time, not user time; users can easily have multiple tabs open on multiple browser instances simultaneously.

我怀疑您的最佳估计是将每次点击的平均注意力时间归因于某个次数,然后相乘.但是,您也可以衡量点击次数.

I suspect your best approximation is attributing some average amount of attention time per click and then multiplying. But then you might just as well measure clicks.

这篇关于衡量网站上的在线时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆