// Getting the country code from the user's IP$.get("https://api.ipdata.co?api-key=test", function (response) {if (response.country_code == 'UK') {window.location.href = "https://uk.store.ipdata.co";} else if (response.country_code == 'DE') {window.location.href = "https://de.store.ipdata.co";} else if (response.country_code == 'AU') {window.location.href = "https://au.store.ipdata.co";}}, "jsonp");
This example will redirect users from the UK to https://uk.store.ipdata.co, users from Germany to https://de.store.ipdata.co and users from Australia to https://au.store.ipdata.co.
This an incredibly common usecase for geolocation.