Ad blockers: custom loader works, but event script is still blocked


I was testing script firing with Ad Blocker enabled and what I have found is that the GTM script isn’t being blocked, because it’s created with a custom loader, however, the event script created with GA4 Tag to send events to server is not even loading.

Here’s the scenario with ad blocker disabled:

One other thing I noticed is that even if GTM script created with custom loader isn’t blocked, the event script created with GA4 tag still is! While the event script created with Data tag isn’t.

Ad blocker disabled:
The yellow colored requests are events firing.

Now here’s the scenario with ad blocker enabled:
No event scripts are loaded, which causes events not showing up in the server.

I also tested an event script created with Data Tag, and this one is fired as it’s seen in both pictures.

But there are some limitations of Data Tag regarding GA4, like correctly recording session_id, user_engagemet, first_visit events, etc.

Do you have any recommendations for this issue?

The Ad blocker I’m using is uBlock


This is something new to uBlock.
Can you share your uBlock settings?
We will check what we can do.

It’s default, with no additional settings.


I was thinking of using Data Tag for everything and try to manually reconstruct the page_engagement, first_visit, and session_start metrics in GA4.

I am also thinking about “cypting” al the event names and other info. So for example I’d use my own naming convention for page_view event like “xvb124”, and then “decrypting” it the server container.

Just in case if ad blockers become even more aware and start looking into request parameters.

But maybe that’s something it can be automatically done in Data Tag and Data Client?

But then my question about the GA4 metrics still remain.

Maybe we can try to aproximate what GA4 is doing and sending our own events. For example storing session info in local storage and sending own session_id. Recreating user_engagement metric and its parameters, etc.

Looking forward for any updates on this.


Hi, @Denis,

are there any updates on this? I am now using Data tag for advertising conversions, so there are more conversions recorded, and GA4 tag for GA4 analytics so it has the right session data. But would love to bo only using one tag to capture an event :slight_smile:

Actually yes. we have update.

Data Tag will be not ideal solution for GA4.
And we need to think how to manage GA4 work for uBlock.

Problem is we can’t at this moment find solution as this time uBlock disable API that needed for GA4.
We really hope that we will find solution but our current tests show that if Google will not add support of disabling this API there will be no way to bypass this.

Thanks for the update! So, I’m sticking with my plan to use Data Tag for conversions only and GA4 tag for GA4.

@Gasper_Cerar Try now ga4 with your favorite adblocker :wink:

Magic! :magic_wand: :smiley:

How did you do it?

stape magic, like you said yourself

Kudos! Doing great guys!

1 Like