Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoiding Google Tag Manager blocking by AdBlockers

I have used Amplitude analytics in the past in my react Web app to send event data. However I just started with Google Tag Manager and noticed it does not run because being blocked by adBlockers. Amplitude was always functional because I loaded their Javascript SDK through NPM install 'github:amplitude/Amplitude-Javascript' and initialized it at app load with client API key. I like the approach of Google Tag manager where I dont have redeploy app to make changes to my analytics logic. How can I take a similar approach to avoiding being blocked by adblockers.

It may very well be that Google products are popular so Adblock specifically just block google analytics products not other analytics products.

like image 976
jasan Avatar asked May 02 '17 01:05

jasan


People also ask

Is it legal to block Adblockers?

Yes, it's perfectly legal to block ads. While websites will specifically curate what they show or advertise to consumers, it's up to user behavior to determine how they want to consume that content.

What blocks Google Tag Manager?

As a result, GTM is blocked by most ad blockers and browser privacy tools. It is estimated that 42.7% of internet users use ad blockers, meaning you could be missing anywhere from 8% to 25% of user traffic data if you're using GTM.

Why do Adblockers not work anymore?

Try clearing your cache and cookies Another step that can help ensure AdBlock is working correctly is to clear your browser's cache and cookies: How do I clear my browser cache and cookies, reset my browser settings, and update my browser?

Is Chrome killing AdBlock?

Google's changing how extensions work, and getting rid of the dynamic filtering that ad blockers rely on in the process. In 2023, Google is making a huge change to how Chrome web browser extensions work — and it might be killing Chrome ad blockers in the process.


2 Answers

You don't. If people don't want to be tracked, that is their decision. You should not be forcing people to provide you with any data they do not want to provide. Especially by using some shady "bypassing" measures. Instead-

You could use a cookie to permanently disable your tracking of those who do not wish to be tracked, to help you preserve reliable analytics. See: http://www.multiminds.eu/2016/05/19/how-to-disable-tracking-via-google-tag-manager/

Or, better yet, simply measure the percentage of visitors who have disabled tracking so your analytical data can remain accurate. See: https://marthijnhoiting.com/detect-if-someone-is-blocking-google-analytics-or-google-tag-manager/

like image 197
PsyintZ Avatar answered Oct 16 '22 20:10

PsyintZ


Yes, it's possible.
You can use reverse proxy for Google Tag Manager.

  1. First, download the Google Analytics JavaScript library itself and host it on your server.

  2. Then alter the code in the downloaded library to change the target host from www.google-analytics.com to your own domain name using find-replace.

  3. Replace the link from the default Google Analytics script in your codebase to modified one.

  4. Create a proxy endpoint to Google Analytics servers on your back end. One important step here is to additionally detect the client’s IP address and write it explicitly in requests to Google Analytics servers to preserve correct location detection. Test the results. You’re done!

more detail info on freecodecamp.org/news/save-your-analytics-from-content-blockers and https://analytics-bypassing-adblockers.netlify.com

like image 27
GorvGoyl Avatar answered Oct 16 '22 20:10

GorvGoyl