ishk
ishk

Reputation: 1993

How to track user visits?

I have a Java EE web app. There are 4 tabs in the first page. I want to track the number of visits to each tab for each user.

There is a button in the page, whenever user clicks on the button, then tab should be reordered based on the frequency of visits. When the user logins to the system again, the tab should be reordered based on those visits.

How do I maintain this count?

If I save this in the database, then I have to call the database for each and every visit. Can I use a memcached object for this? When should I save the count in the database?

Upvotes: 1

Views: 189

Answers (1)

CloudyMarble
CloudyMarble

Reputation: 37576

You can save the Information in the database, in a UserVistsTable(UserID, TadID, VisitCount) and read the for theh user on login, during the work you use the information in the memory and on logout ou save the updated in formation in the database again.

Upvotes: 1

Related Questions