Finally I solved it and sharing what I did. I create a property "visit" (data type is label) with each document type and did c# function in xslt file which will update the value of "visit" on every page load. Here is the code
Though in theory this should work, be aware that your code will update the database on every visit.
I'm not sure updating the document cache on every page visit is going to be a good idea in terms of performance at all...
If you are updating a database you might as well write to a custom table and just retrieve this value when needed, or even just write to the file system.
I would strongly consider using Google Analytics API as Chriztian mentioned.
Listing Most Visited Page
Hello,
Is there any xslt example to get list of 10 most visited page in umbraco site?
Thank you for your help
Pnima
Hi Pnima,
I'm not aware of Umbraco tracking this in any way, so I guess you're out of luck trying to do this from within XSLT.
If you're using Google Analytics for tracking usage on the site you might be able to embed some kind of report using their API?
/Chriztian
Finally I solved it and sharing what I did. I create a property "visit" (data type is label) with each document type and did c# function in xslt file which will update the value of "visit" on every page load. Here is the code
Further improvement is most welcome
Thanks
Hi,
Though in theory this should work, be aware that your code will update the database on every visit.
I'm not sure updating the document cache on every page visit is going to be a good idea in terms of performance at all...
If you are updating a database you might as well write to a custom table and just retrieve this value when needed, or even just write to the file system.
I would strongly consider using Google Analytics API as Chriztian mentioned.
Regards,
Rich
Hi Rich,
Thanks for alerting me. I'll look on that too.
Pasang, could you get in touch with me about a possible project.
thanks - hugh
is working on a reply...