跟踪页面浏览量时要存储哪些有用的参数?

发布于 2024-10-08 17:19:32 字数 1432 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏九 2024-10-15 17:19:32

这取决于您网站的公开程度。如果您的网站需要身份验证,您可以拥有更多受控的统计信息,因为您可以跟踪用户(访问者)历史记录。如果用户不需要身份验证,您只能使用服务器变量提供的信息:HTTP_USER_AGENT;远程用户;远程地址;远程主机;远程端口; HTTP_COOKIE; HTTP_USER_AGENT。

我已经为某些非公共站点实现了类似的功能,每次用户登录该站点时,我存储的信息如下所示:

  • 用户密钥
  • 远程主机 IP
  • 日期 登录
  • 最后请求日期时间
  • 总时间连接(分钟)
  • 上次请求分钟数
  • 执行的事件/操作

It depends on how public your site is. If your site requires authentication you can have more controlled statistics because you can trace the user (visitors) history. In the case the user does not require authentication you are limited to the information provided by the SERVER VARIABLES: HTTP_USER_AGENT; REMOTE_USER; REMOTE_ADDR; REMOTE_HOST; REMOTE_PORT; HTTP_COOKIE; HTTP_USER_AGENT.

I have implemented something like this for some non-public site each time the user logs on to the site, the information I'm storing looks like:

  • User Key
  • Remote host IP
  • Date Logon
  • Last Request Datetime
  • Total time connected (minutes)
  • Last Request Minutes
  • Event/Action performed
浪漫人生路 2024-10-15 17:19:32

听起来是一个好的开始,

我倾向于存储访问者的 IP 地址,并通过地理 IP 查找从中导出访问者的位置。

此外,您还可以考虑对 IP 进行反向 dns'ing,以了解您的用户所在的 ISP,您可能永远不会使用它,但如果您有下游缓存导致问题的报告,它可能会很有用。

Sounds like a good start,

I'd be inclined to store visitor IP address, and derived from that via a geo ip lookup the location of the visitor.

Also you could consider reverse dns'ing the IP to get an idea of the isp you're user is on, you might never use it but then again it could be useful if you have a report of downstream caching causing problems.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文