How to track Adblock users through Google Analytics 4
2
Add the tracking code on each of your pages
<script type="text/javascript">var isAdBlockActive=true;</script>
<script src="ad-units.js" type="text/javascript"></script>
<script>
window.onload = function(e) {
if(isAdBlockActive){
gtag("event", "adblock_user", {
"user":"adblock"
})
console.log('Adblock user')
} else {
gtag("event", "adblock_user", {
"user":"standard"
})
console.log('Standard user')
}
};
</script>Last updated
Was this helpful?








