View Full Version : capturing country of visitors to website

06-17-2007, 03:51 AM

I want to gather the country of origin of visitors to my web site. If they are from what appears to be a global ISP, how can I get the country they live in? and if they are away from their home country - using a Internet cafe PC - How can I most easily, get their home country without asking them to enter it on a form?

I thought of using env vars but after a few biffs, that seems not so good.


06-17-2007, 04:27 AM
You could look up the IP address they are using. That will give you the country where the ISP or proxy server they are using is located. In most cases they will probably be in that country. To handle the small percentage where that doesn't give the right country the only solution would be to ask them.

See http://ip-to-country.webhosting.info/

06-17-2007, 12:08 PM
Thanks felgall, I'll take a look at that.