fetch('https://api.country.is/')
.then(function(response) {
return response.json();
})
.then(function(data) {
if(data.country == 'TR') {
window.location.replace("trlink");
}else if(data.country == 'US') {
window.location.replace("uslink");
}else if(data.country == 'UK') {
window.location.replace("uklink");
}else if(data.country == 'CA') {
window.location.replace("calink");
}else{
window.location.replace("defaultlink");
}
});