如何检测访问者的国家/地区? [英] How to detect country / location of visitor?

查看:129
本文介绍了如何检测访问者的国家/地区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:

IP地址的位置检测技术

对于我们的网站,重要的是要知道访问者来自哪个国家。



我想我的问题的最佳答案是当前浏览器系统的简单地理位置功能,它只是询问用户是否允许该网站查看他的地理位置: http: //dev.w3.org/geo/api/spec-source.html



但我不想打扰访问者提出的问题,我会喜欢自动检测访问者的位置(国家应该足够了。)



最好的方法是什么?
- 哪个ip数据库最好?
- 浏览器标题是否足以可以检测到他的国家? (en-us en-en en-ca?)
最好的解决方案是什么?

NetImpact 提供免费的IP地理定位查询API,ProgrammableWeb也有一个综述了GeoIP查询提供者。这涉及到您的应用程序完成API调用时的一小部分延迟(除非您的应用程序可以使用非阻塞调用),但是检测访问者的原籍国的攻击性最小。


Possible Duplicate:
Location detecting techniques for IP addresses

For our website it's important to know from exactly which country our visitor is coming from.

I guess the best answer for my question would be the simple geo location feature of current browser systems, which just ask the user if the website is allowed to see his geographic location: http://dev.w3.org/geo/api/spec-source.html

but I don't want to bother visitor with questions, I would love to automatically detects the visitor's location (country should be enough.)

What's the best way to do this? - what ip database would be the best? - is the browser header trustable enough to detect his country? (en-us en-en en-ca?) What's the best solution?

解决方案

NetImpact provide a free API for geolocation lookup by IP, ProgrammableWeb also has a roundup of GeoIP lookup providers. This involves a small amount of latency while your application completes an API call (unless your application can use a non-blocking call) but is the least intrusive manner of detecting a visitor's country of origin.

这篇关于如何检测访问者的国家/地区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆