How do you detect a website visitor's country (Specifically, US or not)?

前端 未结 8 2023
無奈伤痛
無奈伤痛 2020-12-12 19:11

I need to show different links for US and non-US visitors to my site. This is for convenience only, so I am not looking for a super-high degree of accuracy, and security or

8条回答
  •  死守一世寂寞
    2020-12-12 20:08

    Depending on which countries you want to distinguish, time zones can be a very easy way to achieve it - and I assume it's quite reliable as most people will have the clocks on their computers set right. (Though of course there are many countries you can't distinguish using this technique).

    Here's a really simple example of how to do it:

    http://unmissabletokyo.com/country-detector

提交回复
热议问题