Method 1: use https://get.geojs.io/v1/ip/geo.js (with jQuery) To get country code: Online demo: https://jsfiddle.net/sans_amour/r49v5w60/ Method 2: use https://get.geojs.io/v1/ip/geo.js To get country code: Online demo: https://jsfiddle.net/sans_amour/mps5y4j7/ Method…