ASPX templates
Version 6.x > ASPX templates > Use Web Analytics Page Views to find most popular pages View modes: 
User avatar
Member
Member
david.thornton-pop - 6/27/2012 10:58:43 AM
   
Use Web Analytics Page Views to find most popular pages
I'm trying to implement some functionality where I can get the 5 most popular documents of a specific Document Type and display them in the sidebar of the site.

I've turned on Web Analytics and Page View tracking is working fine. I can get Page Views for a specific node by doing the following:

HitsInfoProvider.GetObjectHitCount(CMSContext.CurrentSiteID, CMSContext.CurrentDocument.NodeID, HitsIntervalEnum.Year, "pageviews", new DateTime(1753, 1, 1), new DateTime(9999, 1, 1));

This works great, but it only allows me to get the PageViews for a specific page and not get the top "X" documents for a document type.

Does anybody have any thoughts on how I can accomplish this properly?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/27/2012 2:51:28 PM
   
RE:Use Web Analytics Page Views to find most popular pages
Hi,

I would create a custom report where you can use SQL query to get top X items you want.

Best regards,
Juraj Ondrus