Hi, is possible to show banners in specifiek countries using js code like:
// List of countries we want to show banner
var whitelist = ['US', 'CA', 'UK', 'IN']
// Getting the country code from the user's IP
$.get("https://api.ipdata.co", function (response) {
// Checking if the user's country code is in the whitelist
if (blacklist.includes(response.country_code)) {
('show banner');
} else {
("Don't show this banner, but show other")
}
}, "jsonp");
Please show me how i can do that correctly?