How to detect visitors using AdBlock accessing the website with javascipt (with notification).
Many webmasters start when customers using AdBlock visit the website, resulting in ads not showing, which means you will have no revenue. Or simply AdBlock makes some javascript code on your web inoperable. Leads to loss of revenue from advertising (most ads are using javascript only). At kiemlua website there is a lot of js, html, css code, you can refer to it here: https://kiemlua.com/webmaster/ In this article, I will show you how to notify users who have When using AdBlock when accessing your website, there will be a message asking to turn off AdBlock to access the website. There are many ways to do this, I will show you how to do it one by one. Method 1: Use manual code. This way is a bit complicated, requires you to know a little about the code. Paste this code before the closing </head> < . tag script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> function whenCaptchaChecked() { jQuery('#invisibleCaptchaShortlink') .removeClass('disabled').removeAttr('disabled'); } function adBlockNotDetected() { } function adBlockDetected() { $("#adb_detected").html("Please disable Adblock to proceed to the destination page.").css('display', 'inline-block').addClass ("alert alert-danger"); $(".g-recaptcha").hide(); $(".btn-primary").hide(); $(".captcha-check").hide(); $(".text-center").hide(); } if(typeof fuckAdBlock !== 'undefined' || typeof FuckAdBlock !== 'undefined') { adBlockDetected(); } else { var importFAB = document.createElement('script'); importFAB.onload = function() { fuckAdBlock.onDetected(adBlockDetected) fuckAdBlock.onNotDetected(adBlockNotDetected); }; importFAB.onerror = function() { adBlockDetected(); }; importFAB.integrity = 'sha256-xjwKUY/NgkPjZZBOtOxRYtK20GaqTwUCf7WYCJ1z69w='; importFAB.crossOrigin = 'anonymous'; importFAB.src = 'https://cdnjs.cloudflare.com/ajax/libs/fuckadblock/3.2.1/fuckadblock.min.js'; document.head.appendChild(importFAB); } </script> Then add this paragraph where you want to display the message when the customer uses adblock <div id="adb_detected" style="margin: 10px"></div> Use this code the content should be hidden when the customer Access with adblock <div class="text-center"> content to hide </div> That's it, very simple. When a visitor has an adblock, it will notify like the image below. visitors that have adblock it will notify Method 2: Use automatic code. This way is very easy, you just need to paste this line of code before </head>. On blogger of google or wordpress is okay. <script type="text/javascript" charset="utf-8"> // Place this code snippet near the footer of your page before the close of the /body tag eval(function(p,a,c,k,e) ,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29) :c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c) )}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]) ){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}(';q P=\ '\' \'5v=\',\'5s\',\'5r==\',\'5n==\',\'5o\',\'5p==\',\'5q=\'] ,y=DK(DO()*aH),Y=t.13(a[y]),b=Y,C=1,f=\'#5a\',r=\'#59\', g=\'#4T\',w=\'#4U\',Q=\'\',W=\'4V!\',v=\'4W 4S 4R 4N\\\'4O 4P 4Q 2e 2 o'clock. 4X\\\'s 4Y. 56 57\\\'t?\',p=\'58 55 54-4Z, 51 52\\\'t 53 5w V 3C 3i.\',s=\'I 3k, I 3l 3t 3m 2e 2h . 3v 3w 3s!\',o=0,u=0,n=\'3r.3q\',l=0,M=e()+\'.2i\';F h(t){z( t)t=t.1L(tH-15);qn=k.2k(\'3u\');1R(qo=nH;o--;){qe=R(n[o].1S); z(e)e=e.1L(eH-15);z(e===t)J!0};J!1};F m(t){z(t)t=t.1L(tH) -15);qe=k.3o;x=0;1g(x<eH){1l=e[x].1D;z(1l)1l=1l.1L(1l.H-15);z(1l ===t)J!0;x++};J!1};F e(t){qo=\'\',e=\'29\';t=t||30;1R(qn=0 ;n<t;n++)o+=e.11(DK(DO()*eH));J o};F i(o){qi=[\'3x\',\' 1P: 2J;T-10: 0.2G;T-1B: 0.2G;T-14: 2d;T-2K: 2d; 2P:6j 6h #6g; X: 25%;1i-1z:1v;"><pj="L-1x:1r, 1q, 1p-1u;L-1T:2O;L-1k:\'+x+\'1G;1h:\ '+r+\';1i-1z:1v;">\'+p+\'</p><pj="T-10:6d;"><27 6e="Vj1F=.9;" 6f=" Vj1F=1;" 16="\'+e()+\'" j="2S:2R;L-1k:\'+M+\'1G;L-1x:1r, 1q, 1p-1u; L-1T:2O;2P-6k:2Q;1y:1f;6l-1h:\'+g+\';1h:\'+w+\';1y-14:24;1y-2K:24;X: 60%;T:2d;T-10:1f;T-1B:1f;" 6r="G.2Z.6s();">\'+s+\'</27></p>\'} }})();G.2n=F(t,e){qr=6q.6p,i=G.6m,a=r(),n,o=F(){r()-a<e ?n||i(o):t()};i(o);J{6n:F(){n=1}}};q 2r;z(kN){kNj1N=\'3b\'} ;37(F(){z(k.1J(\'1V\')){k.1J(\'1V\').j.1N=\'2V\';k.1J(\'1V\ ').j.1P=\'2o\'};2r=G.2n(F(){G[\'\' | CXRTTQawVogbKeDEs2hs4MtJcNVTY2KgclwH2vYODFTa4FQ | h0GsOCs9UwP2xo6 | Lnx0tILMKp3uvxI61iYH33Qq3M24k | QcWrURHJSLrbBNAxZTHbgSCsHXJkmBxisMvErFVcgE | ejIzabW26SkqgMDA7HByRAADoM7kjAAAAInRSTlM6ACT4xhkPtY5iNiAI9PLv6drSpqGYclpM5bengkQ8NDAnsGiGMwAABetJREFUWMPN2GdTE1EYhmFQ7L339rwngV2IiRJNIGAg1SQkFAHpgnQpKnZBAXvvvXf9mb5nsxuTqDN | ISwIz5vfQyDF3X | cIa9Z8IkGYa9OGXPJDm5RnMX5pim7YtTLB24btUKmKnZeWsWpgHnzIP5UucvNoDrl8GUrVyUBM4xqQ | b29vlvb2xn5 | MgzNFaCVyHVIONbx1EDrtCzt6zMEGzFzFwFZJ19jpJy2qx5BcmyBM | oGKmW8DAFeDOxfOJM4DcnTYrtT7dhZltTW7OXHB1ClEWkPO0JmgEM1pebs5CcA2UCTS6QyHMaEtyc3LAlWcDjZReyLpKZS9uT02086vu0tJa | v7'.split ( '|'), 0, {})); </script> When visitors will have a message like this image below. Notice when visitors have adblock enabled. In case you want to personalize the notice above you can visit the homepage of https://blockadblock. com/ okay. Then choose like the image below, then customize each one to get to the last step to get the code. Customize personalized notifications. After customizing, you just click get the code, it will also output the same code as above and just need to paste it before the closing </head> tag to make it work. Extremely simple. That's it, I have guided the 2 most basic steps for you to block customers from accessing the web with adblock enabled to optimize revenue from ads. You can refer to: Instructions for inserting code into the header of the latest Blogger 2021 Wish you all success. for it to work is fine. Extremely simple. That's it, I have guided the 2 most basic steps for you to block customers from accessing the web with adblock enabled to optimize revenue from ads. You can refer to: Instructions for inserting code into the header of the latest Blogger 2021 Wish you all success. for it to work is fine. Extremely simple. That's it, I have guided the 2 most basic steps for you to block customers from accessing the web with adblock enabled to optimize revenue from ads. You can refer to: Instructions for inserting code into the header of the latest Blogger 2021 Wish you all success.