Bu şekilde çalışıyor
function callback(data) {
country = data.country_name;
country == "Turkey" ? window.location.href = "x.html" : window.location.href = "y.html"
}
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://geolocation-db.com/jsonp/6db070f0-7c27-11ea-8264-e974339fc182/';
var h = document.getElementsByTagName('script')[0];
h.parentNode.insertBefore(script, h);