What’s the best way to implement user tracking throughout your web site when using Razor views in ASP.NET MVC 3.
In webforms I’d put some code in the masterpage to use a cookie and log each url on my site that a person visits in a database, but I’m not sure where to implement this code in ASP.NET MVC.
I guess the best way to do this is to create a Global Action Filter, and track visits there.
Create an action filter attribute:
Register it as a global filter in global asax:
That’s all. Nice?