Is there a super simple way to record/report page views in Rails 2.3.x?

北城以北 提交于 2019-12-25 03:13:32

问题


My Rails app creates a handful of very simple "landing pages" and I'd like to know when a visitor comes to the web page with a "view counter."

Are there a recommended gem, plugin, or maybe some code someone can send to me to help me?

Thank you.


回答1:


Try this plugin .. https://github.com/iorum-ie/acts_as_viewable

It actually checks IP address so visits from the same IP won't be recounted within a period of time.




回答2:


RailsStats should be compatible with 2.3.x




回答3:


I would suggest with redis. It's perfect for realtime stats. It gives you the speed and atomic increments that you want, plus it persists.

If you dont want to rely on external things then try this link.
simple hit counter for page views in rails



来源:https://stackoverflow.com/questions/5295026/is-there-a-super-simple-way-to-record-report-page-views-in-rails-2-3-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!