Best grails implementation for tracking number of views (or unique visitors) for a web page?

三世轮回 提交于 2019-12-11 07:05:52

问题


I need to implement a very popular feature : displaying the number of views for a profile page.

For instance, my profile page in StackOverflow will display how many persons have viewed my profile (just under my reputation score).

I suppose that the algorithm is based on some cookies and/or visitor IP addresses. Is there a simple way (a plugin or some code source) to implement it in Grails running on tomcat/apache?


回答1:


Check out the Clickstream plugin: http://grails.org/plugin/clickstream

I haven't used it directly but it's based on a library that I've used outside of Grails. We considered using the plugin for a project and I reviewed the implementation and it looked solid, but I ended up leaving the project.

This doesn't directly address your request but you could query the table that it creates, or borrow the logic that it uses to do a specialized implementation for tracking individual pages.




回答2:


Why don't you use Google Analytics?



来源:https://stackoverflow.com/questions/3906097/best-grails-implementation-for-tracking-number-of-views-or-unique-visitors-for

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