PageViews

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
3/5/2008 3:19:38 PM
Gravatar
Total Posts 2

PageViews

Hi Joe,

My manager is requesting I track page views. Where would you recommend I hook into your code?

Perhaps the mp_Pages_SelectOne stored ptocedure? I created a seperate table and stored procedure.

Thanks

Steve

3/6/2008 6:17:06 AM
Gravatar
Total Posts 18439

Re: PageViews

Hi Steve,

Assuming you are just talking about logging things like the requested url, the user (if authenticated), the timestamp, etc.

What I would recommend is that you implement an HttpModule, this can be in a separate dll so it doesn't have to touch the mojoPortal code, you just hook it in in the HttpModules section of Web.config

Its position in the section is the order in which the modules are processed. For each request, the HttpModules get to handle the request so you have all the request info you need like the url and the user. If you want to capture the page id then you should proably place your module after the url-rewriter module, then call CacheHelper.GetCurrentPage(); to get the currentPage instance.

So your HttpModule would just do its logging of whatever info about the request you are interested in.

Hope it helps,

Joe

3/6/2008 1:52:29 PM
Gravatar
Total Posts 2

Re: PageViews

Hi Joe,

Thank you very much for the suggestion. That made for a nice clean solution where I didn't need to touch your code!

Steve

 

You must sign in to post in the forums. This thread is closed to new posts.