How to count the no. of hits on the website.

Posted on 2013-02-02
Last Modified: 2013-02-21
1. How to determine no. of visitors visiting the site.
2. How to determine the ip address of the client machine from where the site was accessed.
3. What is code for implementing Visitors Count logic.
Question by:searchsanjaysharma

Accepted Solution

esolve earned 167 total points
ID: 38846871
You can use this on your website to determine the visitors IP address:


For the visitorCount you can use the Application_BeginRequest event in global.asax. See this link. or you can use a free jscript visitor counter

Some more examples here:
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 166 total points
ID: 38847015
The best choice is to use AWStats or a similar program that gets all that info from your server logs.  It is open source and you can get the code for it.
LVL 10

Assisted Solution

by:Monica P
Monica P earned 167 total points
ID: 38850306
Visitors Count

To get client IP

To get the IP address of the machine and not the proxy use the following code

Open in new window


Author Closing Comment

ID: 38914018

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Data Saving(2) 2 41
bulid json format 3 46
Host pages 5 25
rest webservice call over https via c# 6 24
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now