问题
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