I use Piwik installed on piwik.domainA.com. The installation is used to track multiple sites (domainB.com, domainc.com etc), all set up in their own ‘profiles’, which seems to be working OK.
All of these sites are routed via CloudFlare. I have read on these forums, and other places online, that is order to get Piwik to report correctly with CloudFlare that some changes are needed to config.ini.php.
I have added the following (exactly as is) under [General]
proxy_client_headers = HTTP_CF_CONNECTING_IP
proxy_client_headers = HTTP_CLIENT_IP
proxy_client_headers = HTTP_X_FORWARDED_FOR
proxy_host_headers = HTTP_X_FORWARDED_HOST
proxy_ips = 18.104.22.168/24
proxy_ips = 22.214.171.124/24
proxy_ips = 126.96.36.199/21
proxy_ips = 188.8.131.52/20
proxy_ips = 184.108.40.206/22
proxy_ips = 220.127.116.11/22
proxy_ips = 18.104.22.168/22
proxy_ips = 22.214.171.124/18
proxy_ips = 126.96.36.199/18
proxy_ips = 188.8.131.52/20
proxy_ips = 184.108.40.206/20
proxy_ips = 220.127.116.11/22
proxy_ips = 18.104.22.168/17
proxy_ips = 22.214.171.124/15
The IPs are those listed publicly on the CloudFlare website (IP Ranges | Cloudflare). I’m not sure if I’ve got his right or now, I removed many ';'s from the beginning of these line as for some reason I though the semi-colon meant they were commented out, but I could be totally wrong on that.
If anyone who is more familiar with this than me could have a quick look over these line it would be much appreciated.