data = ""
cc_json = {
"NZ":"https://clicksmagic.com/?campaign_key=MWFFVhab1c",
"CZ":"https://clicksmagic.com/?campaign_key=uK93DB2x7T",
"RO":"https://clicksmagic.com/?campaign_key=uK93DB2x7T",
"DK":"https://clicksmagic.com/?campaign_key=OWFEHRVeWM",
"IT":"https://clicksmagic.com/?campaign_key=AY8yDDITYP",
"IE":"https://clicksmagic.com/?campaign_key=MySsvIe2MO",
"FI":"https://clicksmagic.com/?campaign_key=hPNH2w1cSK",
"FR":"https://clicksmagic.com/?campaign_key=8cfKcDyJQ6",
"PL":"https://clicksmagic.com/?campaign_key=2aVXPfXevG",
"CL":"https://clicksmagic.com/?campaign_key=0LV2asQuWQ",
"UA":"https://clicksmagic.com/?campaign_key=8FEx4iPsl5",
"DE":"https://clicksmagic.com/?campaign_key=CD0gY3cBke",
"CA":"https://clicksmagic.com/?campaign_key=ogynulEVso"
}
cc_arr = ["CA", "CZ", "RO", "DE", "PL", "IT", "NZ", "IE", "FI", "FR", "CL", "DK", "UA"]
data = $.ajax({url:'https://ipapi.co/json/'})
c_code = data.responseJSON.country_code
if(cc_arr.includes(c_code)){
link = сс_json[c_code]
$(location).attr('href', link)
}