How to implement a counter of users visiting the site in asp.net mvc
If your question is about "online" users:
Set a counter on application start, on session start increase the counter, on session end decrease it. (in global.asax)
If you want to track views on specific pages, you could increment a counter before you finish executing an action:
public ActionResult Index() { TrafficService.TrackPage("My Index page on controller XYZ", "path"); return View(); }
I am doing something like this on detail pages of blog entries, that way when I show a list of entries to edit I can show the current viewcount. I would not suggest this to heavily though as you are hitting the DB everything your page is viewed. I would suggest using Google Analytics for serious page tracking, including visitors and visits. Much more reliable and faster. Plus it is free and takes two minutes to set up.
You could go the standard page counter like you see on ebay pages but those are not very appealing.
All depends on what your need is and who is going to see the data, some people want a lot of info and others don't. Good luck!