Cloudflare And Google Analytics: Better Together ❤️

Cloudflare’s network and server security features offer you unparalleled protection, but what good is that protection if it blocks you from monitoring your own business?

Google Analytics is your best friend for tracking site performance and understanding how customers interact with articles on your sites, and it’s mission-critical that your tracking data is accurate, on-time, and unfiltered.

Using Cloudflare with Google Analytics is way easier than it sounds, but there are a few quirks about how the services interact—or, more accurately, how they don’t interact.

You should know what to expect when the time comes to implement tracking services on your Cloudflare site. Let’s dive into some details.

Can You Use Cloudflare With Google Analytics?

Yep! Because Cloudflare doesn’t proxy traffic from Google, it doesn’t have any effect on your Google Analytics tracking, and GA will be able to monitor hits freely. Google Analytics uses a simple Javascript code that’s triggered by visitors’ browsers, and this data isn’t filtered through any Cloudflare apps in any way so they work together smoothly

Analytics Compatibility

Google used to offer an app specifically for viewing GA through Cloudflare, but they’ve deprecated the app in favor of unifying Google Analytics under one dashboard.

If you’re encountering an error trying to implement Google Analytics on your Cloudflare site, there’s likely an issue with how you’ve added your tracking code.

Does Cloudflare Affect Google Analytics?

Some Cloudflare apps can interfere with Google Analytics insight reporting, particularly when GA-tracked requests go through your origin web servers.

This happens most frequently with non-HTTP requests you get when visitors are using specific apps or systems on your website.

Since Cloudflare automatically proxies your server, it can prevent Google Analytics from properly reading header information like unique IP addresses.

If Google Analytics can’t confirm that a connection is unique and valid, it won’t count the visitor resulting in a skew in your site stats.

Don’t worry—these are uncommon cases, and in most circumstances, you can expect Google Analytics to report page views.

Cloudflare Analytics vs Google Analytics: Why Are Unique Visitors Different?

Since Cloudflare and Google Analytics use different methods to track your visitors, you’ll see a significant difference in the number reported from each.

Cloudflare Google Unique Visitor Counts

Cloudflare counts every single unique request to your web server regardless of its validity or intent.

Google Analytics tries to account for suspicious or invalid requests by restricting which page hits count as legitimate unique connections.

The result is that Cloudflare’s analytics will tend to be much higher, namely because it is counting a lot more robots than Google Analytics 🤖

This isn’t a bad thing— Cloudflare is trying to give you a full accounting of the activity on your web server while Google Analytics is trying to give you the clearest picture of actual human interaction with your site.

Cloudflare offers more detailed technical explanations for this here.

The unique traffic number from Cloudflare will naturally be higher than the number from Google Analytics.

Since you’re using Google Analytics to monitor traffic to homepages, blog post articles, or landing pages, you don’t want to see other types of non-HTTP requests mixed in.

Thanks to Cloudflare’s built-in activity monitoring, you can separately monitor how traffic is impacting your server versus what it represents in terms of unique engagement with your site.

One Cloudflare community forum post reports seeing 3-4x higher figures in Cloudflare, so it’s not out of the ordinary for the figures to be significantly different.

Why is Google Analytics Showing Zero Traffic?

Google Analytics Zero Traffic

Your site has a unique Google verification code that can track your page hits through Google Search Console.

This code won’t communicate with the Google Analytics systems.

Make sure that you’re using the correct Javascript code for Google Analytics on your website and GA will start tracking your users immediately.

If you’re sure you’ve added the right code and you still aren’t seeing any traffic in Google Analytics, contact your hosting provider to be sure they aren’t proxying traffic in a way that interferes with GA data.

You can request help for your specific situation from the Cloudflare community forums.

If you’re looking for (free) tips to optimize your site speed with Cloudflare and rank higher on Google, you can follow me on Twitter 👉🏻 @bitofseo.

Please DM me if you have any questions about this Cloudflare article (or have some feedback to make it better 😄️).

About Jake Sacino

After working as an engineer and consultant for a bunch of big companies, Jake now works as a full-time SEO & software engineer.