|
| Latest Anti Adblock Script |
Hello everyone, on this occasion I will share how to install Anti AdBlock on Blogger.
AdBlock is a browser extension that works to prevent or block ads from appearing on websites. The purpose of installing AdBlock is usually to make visitors more comfortable when reading articles without being disturbed by ads.
Nowadays, it is not uncommon for blog owners to place too many ads in order to increase revenue. Of course, this can negatively affect visitor experience.
Therefore, we cannot fully blame internet users for using AdBlock for their own convenience.
However, as a blog owner, this can become a serious problem. Blogging income mainly comes from ads—if ads do not appear, there will be no revenue. That’s why we need a solution to prevent AdBlock from blocking ads.
This script works by detecting whether the browser is blocking ads. If detected, it will automatically display a popup notification asking users to disable their AdBlock.
To see the demo, you can try enabling AdBlock when visiting this site or click the button below.
How to Install Anti AdBlock on Blogger
Go to Blogger, choose Theme and Edit HTML.
Copy the code below and place it above the
</body> tag or
<!--</body>--></body>.
<div class='wc-credit' made-by='www.wendycode.com'/>
<script>/*<![CDATA[*/
// anti adblock by wendycode.com => terakhir diupdate pada 20-05-2023
// sudah diaplikasikan dengan lazyload asynchronous : https://www.wendycode.com/2023/01/script-lazyload-asynchronous.html
// script ini hanya berfungsi jika kamu menggunakan kode iklan dari adsanse, tidak dapat menggunakan iklan dari penyedia lain
// kode bawaan https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-0000000000000000 tidak perlu dipasang lagi karena sudah terdapat disini
// id adsanse
var caPub = 'ca-pub-xxxxxxxxxx';
// popup notif bisa di edit jika kamu paham css dan html
function akadb(){document.querySelectorAll("BODY")[0].innerHTML = "<style>@-webkit-keyframes slide-down{0%{opacity:0;-webkit-transform:translateY(-100%)}100%{opacity:1;-webkit-transform:translateY(0)}}@keyframes slide-down{0%{opacity:0;transform:translateY(-100%)}100%{opacity:1;transform:translateY(0)}}</style><div style='width:100%;height:100%;position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.5);z-index:99999;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)'><div style='max-width:500px;position:relative;background:#fefefe;border-radius:10px;border:1px solid #eee;color:#262d3d;text-align:center;padding:35px;top:150px;margin:20px auto;box-shadow:0 10px 20px rgba(0,0,0,0.2);-webkit-animation:slide-down 2s ease-out;animation:slide-down 2s ease-out'><svg style='fill:#e00000;width:50px;height:50px' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><path d='M7.775 0a1.8 1.8 0 0 0-1.273.527L.528 6.503A1.8 1.8 0 0 0 0 7.775v8.45c0 .478.19.936.528 1.274l5.974 5.974A1.8 1.8 0 0 0 7.775 24h8.45a1.8 1.8 0 0 0 1.273-.527l5.975-5.974A1.8 1.8 0 0 0 24 16.225v-8.45a1.8 1.8 0 0 0-.527-1.272L17.498.527A1.8 1.8 0 0 0 16.225 0zm4.427 3c1.02 0 .958 1.108.958 1.108v6.784s-.009.218.16.218c.188 0 .175-.226.175-.226l-.002-5.63s-.05-.986.959-.986c1.01 0 .97.983.97.983v7.621s.014.158.141.158c.127 0 .944-2.122.944-2.122s.451-1.497 2.576-1.1c.038.008-.167.688-.167.688l-2.283 6.556S15.69 20.7 11.714 20.7c-5.044 0-4.808-5.407-4.814-5.405V7.562s-.016-.99.897-.99c.858 0 .849.99.849.99l.007 3.583s-.004.172.167.172c.16 0 .141-.172.141-.172l.01-5.926s-.055-1.162.966-1.162c1.04 0 .983 1.142.983 1.142v5.611s-.005.204.152.204c.168 0 .154-.206.154-.206l.01-6.693S11.18 3 12.202 3Z'/></svg><h2 style='margin-top:15px;font-size:17px'>Pemblokir Iklan Terdeteksi</h2><p>Harap matikan AdBlock atau DNS yang memblokir iklan agar dapat akses situs ini.</p><a href='https://www.wendycode.com/p/kontak-kami.html'>Butuh bantuan?</a></div></div>";}
// global script jangan di edit
function adAdbLoad(){var d=document.createElement("script");d.async=!0,d.src="https://cdn.wendycode.com/blogger/globalAdb.js",document.body.appendChild(d)}function dtcLzy(){adAdbLoad(),localStorage.setItem("wcAdAdb","true")}var wcAdAdbStrg=localStorage.getItem("wcAdAdb");if("true"!=wcAdAdbStrg){var d=!1,t=!1;window.addEventListener("scroll",()=>{(0!=document.documentElement.scrollTop&&!1===d||0!=document.body.scrollTop&&!1===d)&&(dtcLzy(),d=!0,t=!0)},!0),window.addEventListener("click",()=>{!1===e&&!1===t&&(dtcLzy(),t=!0,d=!0)},!0)}"true"===wcAdAdbStrg&&adAdbLoad();
/*]]>*/</script>
The highlighted parts above can be customized. If you want to change popup text, styles, or layout, edit the popup section using a text editor like Notepad for easier modification.
// popup notif
function akadb(){document.querySelectorAll("BODY")[0].innerHTML = "<style>@-webkit-keyframes slide-down{0%{opacity:0;-webkit-transform:translateY(-100%)}100%{opacity:1;-webkit-transform:translateY(0)}}@keyframes slide-down{0%{opacity:0;transform:translateY(-100%)}100%{opacity:1;transform:translateY(0)}}</style><div style='width:100%;height:100%;position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.5);z-index:99999;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)'><div style='max-width:500px;position:relative;background:#fefefe;border-radius:10px;border:1px solid #eee;color:#262d3d;text-align:center;padding:35px;top:150px;margin:20px auto;box-shadow:0 10px 20px rgba(0,0,0,0.2);-webkit-animation:slide-down 2s ease-out;animation:slide-down 2s ease-out'><svg style='fill:#e00000;width:50px;height:50px' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><path d='M7.775 0a1.8 1.8 0 0 0-1.273.527L.528 6.503A1.8 1.8 0 0 0 0 7.775v8.45c0 .478.19.936.528 1.274l5.974 5.974A1.8 1.8 0 0 0 7.775 24h8.45a1.8 1.8 0 0 0 1.273-.527l5.975-5.974A1.8 1.8 0 0 0 24 16.225v-8.45a1.8 1.8 0 0 0-.527-1.272L17.498.527A1.8 1.8 0 0 0 16.225 0zm4.427 3c1.02 0 .958 1.108.958 1.108v6.784s-.009.218.16.218c.188 0 .175-.226.175-.226l-.002-5.63s-.05-.986.959-.986c1.01 0 .97.983.97.983v7.621s.014.158.141.158c.127 0 .944-2.122.944-2.122s.451-1.497 2.576-1.1c.038.008-.167.688-.167.688l-2.283 6.556S15.69 20.7 11.714 20.7c-5.044 0-4.808-5.407-4.814-5.405V7.562s-.016-.99.897-.99c.858 0 .849.99.849.99l.007 3.583s-.004.172.167.172c.16 0 .141-.172.141-.172l.01-5.926s-.055-1.162.966-1.162c1.04 0 .983 1.142.983 1.142v5.611s-.005.204.152.204c.168 0 .154-.206.154-.206l.01-6.693S11.18 3 12.202 3Z'/></svg><h2 style='margin-top:15px;font-size:17px'>Pemblokir Iklan Terdeteksi</h2><p>Harap matikan AdBlock atau DNS yang memblokir iklan agar dapat akses situs ini.</p><a href='https://www.wendycode.com/p/kontak-kami.html'>Butuh bantuan?</a></div></div>";}
That’s all for this guide on how to install Anti AdBlock on Blogger . Thank you for visiting, and I hope this is useful.