Using Cloudflare for geolocation detection can reduce server load, especially for websites with high traffic. We recommend enabling this feature for better performance. Follow the steps below to configure Cloudflare settings:
Step 1: Enable IP Geolocation in Cloudflare
- Log in to your Cloudflare account and select the specific domain.
- Go to the Network tab in the dashboard.
- Find IP Geolocation and switch the toggle to On.
Learn more about IP Geolocation in Cloudflare
Step 2: Add Visitor Location Headers
- Log in to the Cloudflare dashboard and select your account and website.
- Navigate to Rules > Transform Rules.
- Select the Managed Transforms tab.
- Enable the desired transform to add Visitor Location Headers.
Learn more about Managed Transforms and Location Headers
Why Use Cloudflare for Geolocation Detection?
- Reduced Server Load: Cloudflare processes geolocation data before it reaches your server.
- Better Performance: Especially useful for large websites with high traffic.
Once these settings are enabled, WP Statistics will fetch visitor geolocation data using Cloudflare headers instead of relying on server-side detection methods like MaxMind GeoIP.
Where to Enable This Feature
You can enable this feature in WP Statistics by going to:
Settings → Advanced Options → GeoIP Settings → Location Detection Method
Select Cloudflare IP Geolocation from the options.