Asked

how to implement number of views for each item detail page?

Google analytics vs. keeping track of total views for each item detail page. What is the best way to track?

What stack are you working with?

Java, Spring MVC, Hibernate

If I understand your problem, seems like you have to manually trigger/fire a "view", after a dynamic page change on your site?

GA is fine. Use their api to pull info periodically cache it.

If you implement something custom, make sure its JS based and not done while generating the page to server things.
With html cache, you fail to record metrics. Without it, even typing url on chrome, would register 2 hits cuz chrome fires request right away before typing to urls that might be what you want, before you select one suggestion or hit enter.

You are correct. I found out GA is doing all this. so data gathering becomes easy. The next thing is retrieving those data from GA. So are you seeing pull this data from GA and store them in database and get updates from GA periodically?

Yes! WordPress even has a plugin for it but I had to fix an issue in it to make it work for my client. This was sometime last year.

Thank you buddy. I will try it.

You are correct. I found out GA is doing all this. so data gathering becomes easy. The next thing is retrieving those data from GA. So are you seeing pull this data from GA and store them in database and get updates from GA periodically?

Sign in to answer 😃