IP Geolocation using Cloudflare

Cloudflare offers a neat feature for free to capture the country code of visitors hitting your web server. This can be useful for many different applications.

For example, if you would like to offer discounts to customers from other countries, block certain countries from accessing your website, or even block users on the Tor network.

IP Geolocation in Cloudflare is enabled in the Network tab of your Cloudflare dashboard. The country code is visible in the CF-IPCountry header in the ISO 3166-1 Alpha 2 format. Check out the official guide here.

Thanks for reading. Make sure you follow me on Twitter to stay up to date on the progress of my side projects T.LYWeather Extension, and Link Shortener Extension. If you are interested in the tech I use daily, check out my uses page.  

Leave a Reply

Your email address will not be published. Required fields are marked *