[RESOLVED] Get Information About Visitors To Your Website
I just created a download counter on my website that increments when a download link is clicked. It also records the times of the downloads in a database. Along with that I was wondering if I could gather some general information about location of the visitor to my website that clicked the download link. Is there a way to do that? Maybe you're not supposed to try to get overly specific data because that would be a sort of invasion of privacy but if I could collect something that would tell me an approximate location of the visitor to my website that clicked the download link that would be nice if that can be gotten without too much trouble.
Re: Get Information About Visitors To Your Website
HttpRequest.UserAgent Property - Shows the user browser name
HttpRequest.UserHostAddress Property - Gets the IP Address of the client
HttpRequest.UserHostName Property - Gets the user dns name
HttpRequest.UserLanguages Property - Gets the User language property
Re: Get Information About Visitors To Your Website
You can get location details about a users IP address - country, city etc. I googled for free services and maybe one of these will do the trick.
http://blog.programmableweb.com/2009...olocate-by-ip/
Re: Get Information About Visitors To Your Website
Thanks for the replies. So step 1, get the IP address of the user. I found success in doing this using some code that I found in an msdn forum. I have to work on some details with my database table and my SQL update code for it and then I'll look into getting location by using the IP address and have a better look at the blog that you posted brin351.
Re: Get Information About Visitors To Your Website
Bear in mind that depending on whether a particular user is using some form of Proxy server, the IP address of the incoming request might not actually be the person's actual IP address.
Gary
Re: Get Information About Visitors To Your Website
I went to this site
http://www.geobytes.com/IpLocator.htm?GetLocation
which will convert your IP address into a location and for my IP address it gave Cicinnati, Ohio and I live in California. That's a professionally done IP address locator and it wasn't even close(at least it got the country right). I got my website code so it records IP address for every download. I can always look up some IP address location manually when I want. The IP address it gives for me is 24.223.108.2. I noticed if you alter the first 2 digits left of the first period that will give you different countries and the next three usually indicate different states for the US and the next 3 for different cities but can also change state. Sort of interesting.
Re: [RESOLVED] Get Information About Visitors To Your Website
ISP's own the IP addresses and some assign static IP's to users others dynamic and as Gray mentions there can be proxies etc involved. At the moment my static IP for the past couple of years is well recorded by many of these services. If I asked for a new IP they would more than likely get my location wrong.
Exactly how and where these services get their info I'm not sure. Google are pritty good at tracking us :)
Re: [RESOLVED] Get Information About Visitors To Your Website