
When I developed my Minimal Google Analytics 4 snippet, I thought about preventing it from being blocked by various AdBlockers.
Along with AdBlock Plus, I am also using the DuckDuckGo Privacy Protection extension in Safari. I am using the DuckDuckGo browser on its own as well.
DuckDuckGo, along with restrictive ad blockers, tends to block requests heading to the google-analytics.com
domain. This is done on purpose, and I fully understand that.
This is why I described mitigation techniques (Minimal Analytics 4 - masking (hiding) requests).
This technique allows you to utilize Redirect 200 to mask requests to external domains under your domain.
By implementing a redirect as follows:
/g/collect https://www.google-analytics.com/g/collect 200
Instead of calling the address below in a script
https://www.google-analytics.com/g/collect
I am calling this
https://www.example.com/g/collect
Behind the scenes, thanks to Redirect 200, I am sending requests to Google Analytics that are not blocked by either AdBlock Plus or DuckDuckGo.
This solution, however, has 2 major flaws.