How does the webtracker recognize ad blockers?

We often get the question of how the webtracker actually works, how we are able to recognize when data is blocked by ad blockers and how we forward this to Google Analytics. In this blog we’ll explain exactly that. After reading this blog,
you will understand how Google Analytics works; how ad blockers are able to block Google Analytics from receiving data; how the webtracker recognizes ad blockers and how the webtracker forwards blocked data towards Google Analytics.


Note that this is a rather technical blog.

If you have any questions on this topic, feel free to reach out to support. We are more than willing to clarify any questions you may have.

How Google Analytics works

To understand how ad blockers work and how the webtracker solves this, it is useful to understand how Google Analytics works.

Google Analytics itself is a script that is downloaded from With this script, Google Analytics is initiated in the browser of your client, and fires off events to the google collection point on

If you’re using Google Tag Manager, the same process happens, but the Google Analytics script is actually loaded from within the Google Tag Manager script.

How ad blockers work

Ad blockers and privacy tools are external plugins that can be installed in your browser. Popular ones are uBlock and Ghostery for example. Firefox and Microsoft Edge already have an ad blocker installed, and can be turned on in the settings. Both are primarily designed to block advertisements shown on websites, such as display ads or other banners. They do that by black-listing known advertising URLs. Traffic to and from these URLs will be intercepted by the ad blocker and blocked.

A downside to this for website owners is that a lot of blockers have started to block and as well. Meaning that the client is not able to download (and thus, execute) the analytics script. Even if you were able to load in the script (for example by self-hosting the analytics script on your own website), you might be able to initiate Google Analytics, but any events forwarded to this URL will be blocked
as well by the ad blockers.

How the webtracker recognizes ad blockers

You might ask yourself, how can the webtracker recognize if an ad blocker is active?
The key lies in how Google Analytics is initiated.

First off, the the webtracker script runs parallel to the Google Analytics script
(this is so we don’t infringe upon any GA settings, making it both easier to
setup or deinstall TraceDock if you want to).

As the the webtracker script is loaded, it will recognize if Google Analytics is set
up. Simplified, our method looks at the window constant where a GA instance is
loaded, e.g. (which is defined on windows['GoogleAnalyticsObject']).
If is undefined, google analytics is likely not setup and the webtracker
assumes it is blocked.

We have a few more checks in place to verify if it is a timing issue for quick
reloads, a filter for bots that are visiting the site, and some other edge-cases
that we stumbled upon while testing our solution with our first clients.

Once we recognize the state of the visitor, we forward any events to the
collection point hosted on your own subdomain where the webtracker lives.

How about performance?

If you think that setting up a second script might harm your website’s performance? Be assured, it does not. The the webtracker script is gzipped, 10kb large and due to our blazing fast servers it gets loaded in under 25ms. Your visitors will not notice the difference.

Can the webtracker be blocked?

Often when we explain how the webtracker works, we get the follow-up question: why is the webtracker not blocked?

The short answer is: anything can potentially be blocked by a browser, but it is unlikely that the webtracker itself will be blocked.

The long answer is, we set up a data collection point on your own subdomain. This subdomain is any one of the 1000 most common subdomains such as,, etc. We set up the DNS of the endpoint to a generic load balancer of Amazon or Google – depending on the cloud provider you choose. The script is minified, uglified and compiled specially for your domain. The name is chosen from a set of common javascript names, such as main.js, run.js, choose.js, cms.js. The same holds for the endpoint. So yes, the webtracker can be blocked, but at the time of writing, it is unlikely.

How does the webtracker forward the data to Google Analytics?

the webtracker acts as an event round-about, receiving data from your visitors and forwarding them to Google Analytics if an ad blocker is identified. For debugging purposes, we store the events for 24 hours so that you can access them in the the webtracker portal.

If we recognize that Google Analytics is blocked, we forward the data using the Google Analytics Measurement protocol. This is a “server to server” way of sending data to your Google Analytics account. All session and browser information such as the useragent, path, screen-sizes will be forwarded as well. Next to page views, you can also configure click events and datalayer events for ecommerce or extend basic hit information with custom dimensions and metrics.

How about the users’ privacy?

the webtracker always has the anonymizeIP feature of Google Analytics enabled, and we even anonymize the IP address by blocking out the last octet. This results in forwarding the data with, for example, IP becoming`. Geo-based analysis is still possible but only on a larger scale.

Besides that, you can configure the webtracker to work as you please. For instance, you could decide not to fire the webtracker if somebody opts out in your privacy preferences. Furthermore, visitors with ad blockers are not added to the Google audience builder. This means that if you have an ad blocker we can only analyse your data – anonymously – and not retarget you with downstream ads.

We believe that statistical analytics are essential to creating a great digital user experience. The webtracker enables companies to do just that.

In conclusion

With this blog we tried to explain how the webtracker works to recognize ad blockers and forward any blocked data – in a privacyfriendly way – to your Google Analytics. We believe that with a growing usage of ad blockers it is a must to set up first-party analytics to improve your online marketing. Hopefully this will give you some inspiration to set something up yourself or install the webtracker if you don’t want the hassle.

If you are interested, have more questions or want to see how the webtracker works, please reach out to our support team.