0

I am trying to determine a users country without asking for there permission. Example: When I go onto JD.com which is a world wide company it automatically brings me to JD.ie without asking for a location.

I have already tried the geolocation in JavaScript but I don't need there exact location and it asks for the users permission.

Crann Moroney
  • 356
  • 2
  • 4
  • 13
  • Web sites do it though the IP address (with the help of a geolocation database). You typically need server-side technologies for that but [there're always ways](https://stackoverflow.com/questions/391979/how-to-get-clients-ip-address-using-javascript). – Álvaro González Jul 12 '19 at 17:03

1 Answers1

1

How about using an API to get their location based on their IP address? Here is one I found http://ip-api.com/.

You will have to retrieve the user's IP in your backend of course.

Eric Svitok
  • 792
  • 5
  • 11