How can I calculate number of times a record has been viewed?
-
1if that is viewed by VF page only - add some action to VF page that is executed when page is loaded and increase some counter.– kurunveMar 25, 2016 at 6:22
-
Actually, what do you put in 'view'? Is it when your record appear in search results or just open in separate detail page? Or maybe, retrieved via SOAP/REST API?– Andrii MuzychukMar 25, 2016 at 7:07
-
1Sid.. you may want to look into this post Page Views Counter widget in salesforce and Working with Cookies on Sites pages– Ratan PaulMar 25, 2016 at 9:05
1 Answer
If you display the record in a Visualforce page, you can include Google Analytics code in the page. This will generate stats on sessions, page-views and users. Here's some sample code.