in ,

How to Bypass Ad Blockers with CAOS for Google Analytics

Ad Blockers, a thorn in the side of every online business. Wouldn’t it be great if we could bypass those Ad Blockers and keep our Google Analytics data accurate?

That’s what Steve from thought, when he contacted me with a well-researched feature request for CAOS. A stealth mode to bypass (most) ad blockers. Today I’ll show you the base principles of bypassing Ad Blockers and protecting your Google Analytics data with CAOS.

Why should I bypass ad blockers?

Before we dive into the how’s, the why might be a better place to start.

We can all agree that trustworthy analytics data is key for any online business. You, a business/blog owner, want to know your customer/visitor.

A graphic showing more accurate Google Analytics data. A signifant increase of traffic.
Using CAOS’ Stealth Mode gave me more accurate Google Analytics data.

I respect the choice to use an ad blocker on the internet. I use it too. To protect my privacy, but more importantly, to protect my system. Advertisements are often injected with malware. That’s one of the reasons why I removed the advertisements on this site a few months ago.  To protect you, my guest.

Then isn’t it a dangerous practice to bypass ad blockers? In case of advertisements and/or malware, yes. In case of Google Analytics, no. As long as it is used responsibly. This means:

How does an Ad Blocker work?

Each ad blocker uses a different approach.

In earlier versions, CAOS already circumvented the easier ad blockers, since they’d only block files loaded from Hosting analytics.js locally resolved that.

Nowadays most ad blockers (including the tracking protection built into browsers) will simply block all requests made to blacklisted domains, such as, while some extensions block files ‘intelligently’ — based on the content of a file.

We can work around the first approach with relative ease, while attempting to crack the latter means crossing some serious ethical boundaries.

How to Sneak your Data past Security

It’s starting to sound like I’m teaching you how to smuggle USB sticks across the border. You wish! But while we’re on the subject: peanutbutter.

Most ad blockers block all requests to blacklisted domains. This is exactly where its weakness lies. It can’t (and shouldn’t) block requests to the current domain, because that would cause some serious errors — rendering the ad blocker itself unusable.

Exploiting this weakness is best explained using this stunning illustration, made by yours truly — autographs after the show, please:

How to Sneak Google Analytics Data past Ad Blockers
You can protect your Google Analytics data by making a detour through your website’s server.

Usually, the webpage instructs the browser to make a request to The ad blocker ‘sees’ this request and says: nuh-uh!

To bypass the Ad Blocker, we need to send Google Analytics’ data through the server hosting the website. We instruct the browser to make a request to and that request is proxied to Google Analytics — through the backdoor, so to speak — where the ad blocker is not present.

Prevent Ad Blockers from Blocking Google Analytics Data with CAOS

At this point, you must — you should, actually — be thinking: what an amazing idea — and an even more amazing person! How do I get my hands on this?

CAOS' Stealth Mode can be enabled by simply checking the corresponding checkbox
Simple check the box, save changes, manually update analytics.js and you’re ready to go!

Well, If you’re already using CAOS, you might’ve noticed the new Stealth Mode in the plugin’s settings.

Since v2.7.0 CAOS is officially the only Google Analytics plugin for WordPress with a Stealth Mode feature, allowing you to bypass ad blockers and browser built-in tracking protection, preserving your precious Google Analytics data.

Stealth Mode can also be used in compatibility mode. This means that you can use it in Monster Insights, WooCommerce GA Integration and other GA plugins — and it’s completely free! Go ahead, download it now!

Written by Daan van den Bergh

Magento 2 Developer by day. WordPress Plugin Developer by night. Wordpress Optimization Super Hero at WoOSH! Passionate about trainlifting, airplane-gliding, hunting trees and creating fake hobbies.


Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.