Piwik + CloudFlare = missing more than half the visits/visitors

Hi,

I have a wordpress site using Cloudflare. The WP plugin Wordfence, with Live Traffic activated, records visitors (real) from Malaysia, Ireland, Canada, China, UK etc. but they don’t show in Piwik. Also, Google’s Referrer URL doesn’t show up like it does in Wordfence. My host is HostGator (shared hosting) - I read something about getting my domain “whitelisted” because of mod_security? What is that about and is it relevant when I do see some visitors?

After reading this post I tried adding data-cfasync=“false” to the tracker code in the script tag, like:

<script data-cfasync=“false” type=“text/javascript” … but I read that I should add it twice in the code. I only added it in one place because I didn’t know where else to add it than the very first line. Where else to add it?

I also tried adding a page rule in CloudFlare with everything off (except for security) for the directory where piwik is installed. Don’t think that did anything…

Please help - Piwik looks too good to be uninstalled!
Thanks.

Try contacting your host to get mod_security white listed

Thanks but what about the data-cfasync=“false” thing - do you know where else to insert it than the very first line of the Piwik code?

Also, do you know if there are any problems with using the “post” method instead of getting mod_security white listed? Is the “post” method just as secure and fast/light as the whitelist solution?

Thanks :slight_smile: