Using Cloudflare with Google Analytics

Understand how Cloudflare integrates with Google Analytics.


Since Cloudflare does not proxy Google traffic, Cloudflare has no effect on Google Analytics (GA) tracking.  Your site visitors will interact with Google's servers directly.  The Google Analytics Javascript code on your pages is 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.

Cloudflare actually offers a Google Analytics App available through the Apps app.

Cloudflare proxies traffic to your origin web server. Therefore, the Cloudflare connecting IP matters only for any programs that read logs directly from your web server (like awstats).

Maintain only one instance of the Google Analytics tracking code on your site. Multiple instances double the statistics reported by Google. Multiple instances commonly occur when the Cloudflare Google Analytics App is enabled for a domain that already contains manually inserted analytics tracking code snippets.

Disable Ad Blocker plugins in your web browser when when enabling the Google Analytics App for your Cloudflare domain.  Otherwise, you will observe a generic error when enabling the Google Analytics App:

  An error occurred.

Related resources


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