3

I have a MVC application written in C# that supports Mobile view. I would like to record the stats on the number of users accessing the website from Mobile Phone (can be any phone) vs Computer(assuming PC/Mac), is there any way to do this?

Additional info: I need to display this stats to the users on the website.

C.J.
  • 3,409
  • 8
  • 34
  • 51
  • Check the agent string that is already being logged by IIS. You don't have to do change anything in your code, just check the IIS logs – Panagiotis Kanavos May 27 '15 at 15:46
  • But I need to display the stats to the users (on the website itself) – C.J. May 27 '15 at 15:48
  • 2
    This is a different thing. Once you process the logs, store the statistics somewhere and display them. All sites do this periodically, eg with a job. If you don't want to write this yourself, use Google Analytics and display a mashup – Panagiotis Kanavos May 27 '15 at 15:52
  • Panagiotis Kanavos beat me to it, I was going to recommend Google Analytics. Just add a little JavaScript to the pages and you can see quite a bit of data about the traffic on the site, including what type of devices are being used. – James Nelli May 27 '15 at 15:55
  • possible duplicate http://stackoverflow.com/questions/121280/how-do-i-detect-what-browser-is-used-to-access-my-site – Nikos M. May 27 '15 at 16:07
  • @PanagiotisKanavos can you show me where the log is? – C.J. May 27 '15 at 16:20

1 Answers1

-1

HttpCapabilitiesBase.IsMobileDevice

Gets a value indicating whether the browser is a recognized mobile device. (Source - MSDN)

Adersh M
  • 596
  • 3
  • 19