Does Cloudflare affect Google Analytics?

No, not at all. If you use Google Analytics or a system that tracks logs through a script on your web pages, then Cloudflare does not affect any of your Google Analytic tracking. We have actually built a Google Analytics app so you can make sure that Google Analytics is installed on all of your pages.

Why? GA works by inserting a piece of Javascript (JV) on your site. This JV interacts with the Google servers. When visitors come to your site, they interact with the Google servers. Since Cloudflare's proxy does not sit between the Google servers and your visitor, we have no effect on GA. Instead, Cloudflare sits between your visitor and web server. So, the Cloudflare connecting IP matters only for any programs that read logs directly from your web server (like awstats).

For more technical folks another way to think about it is that Javascript is first a browser-side script, unlike server-side languages such as PHP. The Google Analytics Javascript code on your pages gets executed by the user's browser, so Google Analytics sees the IP of the user's browser. (The GA Javascript code on your page doesn't talk to your site, so it doesn't interact with CF.)


It is important to only have one instance of the Google Analytics tracking code on your site. Having multiple instances, which can occur by manually adding the code snippet and enabling the Google Analytics App for the domain, will likely result in double the amount of statistics reported by Google as both instances of the snippet utilize the same six tracking cookies.

Not finding what you need?

95% of questions can be answered using the search tool. This is the quickest way to get a response.

Powered by Zendesk