Find a site visitor’s location.
Introduction
Last updated: 26 Nov 2025
In this example, we demonstrate how to find a site visitor’s location and display their country using the Wix Window API.
We added the following to our site:
The code in this file finds the site visitor’s geolocation coordinates and displays the visitor’s country.
In this file, we:
window.getCurrentGeolocation.The code in this file receives the geolocation coordinates from the frontend and gets the country name with the following method:
getCountryFromCoords: Receives the latitude and longitude coordinates of the site visitor and then returns the country name after:
which-country-ne-10m package.i18n-iso-countries package.Join the Wix Studio community on Discord, where experienced developers and fellow creators come together to share tips, troubleshoot issues, and collaborate.
Building a coded solution on your own can be challenging. Let an experienced Wix developer build it for you, so you can keep working on your site or business. Visit the Wix Marketplace to find a trusted developer.