开发者

Is it possible to track the country where a user is accessing a particular website?

I wish to track a user's country from where my website is accesed . ex; if a customer from a part开发者_StackOverflow中文版icular is accessing say america how to trace that the user is actually from america. Is there any way


What you are talking about is called GeoIP and there are many ways to do it. Normally this is done using a third party that has a mapping of IP addresses to physical locations.

This is of course not 100% accurate, as people may be using VPNs, TOR or simply spoofing addresses.


It's not possible in all cases, but most IP addresses can be mapped to a location (even down to the city). There are quite a large number of such geomapping services.


Use MaxMind service. http://www.maxmind.com/app/javascript_city They got free and paid versions.


You can determine the country of the IP address of last proxy that a user is using. This is often their country, but not always.

Users can set out to obscure it e.g. by using TOR or another proxy service.

Or their ISPs might be passing them through NAT or through other countries.

And what do you do with the information? Offer them the site in their presumed-native language? Or customise your contact details appropriately?

So you have to think carefully about how you use this information. It is a good idea to present a page in the native language that you think the user is surfing from, but you must make it easy and obvious for the user to change their country. Not all surfers in any given country actually speak the language, and not all people can call toll-free numbers, and not all people in one country are wanting support that's specific to their country, they may be seeking support for when they are elsewhere or for a friend etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜