对我来说,跟踪 Rails 应用程序上的页面浏览量最简单、最可靠的方法是什么?
我已经使用 Google Analytics 足够长的时间了,知道它的工作效果不是很好(手机上的问题以及对于禁用 Javascript 的人来说,更新的滞后时间太长)。目前,我只是记录页面发出的每个请求并更新数据库中的计数器,但我知道这是低效且非常粗糙的(我不区分人和机器人,我将每个页面刷新记录为新的)看法)。
对于构建一个简单的浏览量计数器,您有什么建议?另一种网络分析服务?编写我自己的计数器,内置规则,例如要求 5 秒内来自同一 IP 的多个综合浏览量不算数?我看到有些人建议解析我的生产日志 - 我正在 Heroku 上部署,但不知道从哪里开始。
谢谢。
I've used Google Analytics for long enough to know that it doesn't work very well (issues on mobile phones and for people who've disabled Javascript, WAY too much of a lag time in updating). Currently, I'm just logging every request made of a page and updating a counter in my database, but I know that's inefficient and very crude (I'm not distinguishing between people and bots, I'm logging every page refresh as a new view).
What do you suggest for building a simple pageview counter? Another web analytics service? Writing my own counter that builds in rules like requiring that multiple pageviews from the same IP within 5 seconds of each other don't count? I've seen some people recommend parsing my production logs - I'm deploying on Heroku and don't have any idea where to start with that.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们不久前从 GA 迁移到 GetClicky,而且效果要好得多。
他们还提供非 JS 跟踪代码。尝试一下。
We moved from GA to GetClicky some time ago and it's far far better.
They provide a non-JS tracking code as well. Give it a try.
在机架中间件中做您想做的事。你可以在里面放入你想要的所有代码。
Do what you want in a rack middleware. Inside you can put all code you want.