Using CloudFlare for Geolocation

Article Topics: Setup

NATS uses GeoIP to determine the location of visitors who hit your site. This is to ensure NATS can provide the best reporting to our customers. Should you wish to use CloudFlare IP geolocation, we have provided a way to accomplish this.

CloudFlare's IP Geolocation adds the cf-ipcountry header to all requests to your server, while cf-region-code adds the visitor's region code. NATS will use these headers, if present, to determine the visitor's country and/or region.

circle-info

Important: Should the headers not be present, NATS will use the IP_FILTER settings.

Enable IP Geolocation at Cloudflare

  1. Log in to your Cloudflare account and go to a specific domain.

  2. Go to Network.

  3. Switch the toggle for IP Geolocation to On.

Learn more at https://developers.cloudflare.com/network/ip-geolocation/arrow-up-right.

Configure in NATS

The Prefer Cloudflare Geo Location setting can be found in the Surfer Section of the Configuration Admin, underneath the Tracking settings. Enabling this setting will prioritize the CloudFlare headers, falling back to the settings configured in IP Filter.

GeoIP2chevron-right

Last updated

Was this helpful?