I'm trying to build a hit counter for different parts of the website in ASP.NET MVC - any idea where the best place to do this would be, or a good way to do it? We're wanting to track how many hits individual parts of the website get.
You'll need some kind of data store which can persist your data when you application is not running. Here are some choices: File (XML, JSON, plain text, etc.): sample xml code for visitors counter. Database (SQL Server, SQLite, etc.): sample database code for hit counter.
Depending on the granularity you want, here are some options:
If you are looking for website stats, I would use Google Analytics.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With