How can I get stats on redirecting pages?
Anyone know if there is a way to get stats on redirecting pages? For example, how often a redirecting page was viewed. I noticed that the PageData object contains a property called ViewCount but it is always zero. Any ideas?
Thanks,
Craig
Hello Craig,
Currently this property does not get updated, but it is included for future implementations. You can update it from Global.asax file in the Application_BeginRequest event like so for example:
protected
void
Application_BeginRequest(
object
sender, EventArgs e)
var currentPage = SiteMapBase.GetActualCurrentNode();
if
(currentPage !=
null
)
PageManager manager = PageManager.GetManager();
var page = manager.GetPageData(currentPage.PageId);
if
(page !=
null
)
page.ViewsCount++;
manager.SaveChanges();