If you've moved to Cloudflare and noticed a sudden drop in daily active visitors this is how to solve the problem.
Before we jump into a technical fix, let's eliminate the most common Cloudflare issues first. Check that your DNS records, page rules and SSL configurations are correct. Pay attention to:
- Non-WWW to WWW redirections
- Page rules which cause infinite loops
- DNS rules are incorrect, or Cloudflare is not enabled
- Selecting the wrong flexible, strict or full SSL setting
- You may have been counting bot traffic in your previous analytics, making an artifically high visitor count. Cloudflare blocks malicious traffic, leading to lower visitor counts.
Before you switched to Cloudflare, visitors connected directly to your server.
After switching to Cloudflare, visitors connect to Cloudflare, which then retrieves information from your server as required. This allows Cloudflare to act as a reverse proxy, caching frequently requested files and protecting your server.
As visitors don't connect to your server directly anymore, you no longer have access to the visitors IP address.
This causes issues for some analytics tools, which track daily active visitors by their IP address.
Helpfully Cloudflare does provide the original visitors IP address in an HTTP header called
Get the original IP addresses for your visitors into your analytics tool by choosing one of the options below.
- Cloudflare Enterprise: Upgrade to Cloudflare Enterprise and enable the True-Client-Ip setting, following the instructions here
- Apache or Nginx: Install
mod_remoteipfollowing the instructions provided by CloudFlare
- Node: Install request-ip, then pass the user IP to your analytics platform. On Google Analytics, you can send this as an IP override using the
- Other: Get the CF-Connecting-IP and pass this to your analytics tools and/or logs directly