Script Anti-AdBlock untuk Blogger
Banyak pengguna internet yang memasang ekstensi AdBlock di komputer atau HP-nya. Mereka tidak ingin ada iklan yang dirasa mengganggu.
Akibatnya, iklan Google Adsense para blogger tidak muncul. Bagaiamana bisa dapat duit kalau iklan tidak muncul?
Makanya, salah satu cara agar iklan tetap muncul adalah memasang script AdBlock. Nanti akan muncul notifikasi agar pengguna mendisable atau menonaktifkan AdBlocker-nya.
Pengguna yang baik akan menonaktifkan AdBlock karena tahu iklan Adsense adalah sumber penghasilan blogger.
Berikut ini dua kode script Anti-AdBlock untuk blog di Blogger. Saya rekomendasikan kode yang pertama. Jika tidak berhasil, coba kode kedua. Jika gagal juga, artinya tak cocok dengan template blog Anda.
Kode Script Anti-AdBlock untuk Blogger #1
IniBest Anti Adblock Script for Blogger. Kode dan cara pasangnya:
1. Tema > Edit HTML
2. Pasang kode berikut ini sebelum kode </head>
<style> .hidden{display:none;} .center { height: 100%; padding: 0; margin: 0; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; align-items: center; justify-content: center; } .ADs-BG{ background: rgba(255, 255, 255, 0.58); width: 100vw; height: 100vh; position: fixed; z-index: 99999; top: 0; left: 0; } .at-adblock-content-wrapper { box-shadow: 24px 24px 48px rgba(0, 0, 0, 0.4); border-radius: 10px; max-width: 400px; background: #fff; height: auto; width: 100%; } .at-adblock-content { padding: 30px 50px; } .at-adblock-text, .at-adblock-text h3 { text-align: center; font-family: inherit; font-weight: 700; } .at-adblock-text h3 { font-size: 25px; margin-top: 1rem; } .at-adblock-text p { margin: 20px auto; font-weight: 500;font-size: 13px; } .at-adblock-button .ad-btn { line-height: 1em; border-radius: 30px; border: none; border:2px solid #b23939; padding: 10px 20px; width: 100%; background: #b23939; color: #fff; transition: 0.2s; } .at-adblock-button .ad-btn:hover { background: #fff; color: #b23939; border: 2px solid #b23939; } @media (max-width:480px){ .at-adblock-content-wrapper{max-width:300px}.at-adblock-text h3{font-size:20px}.at-adblock-text p{font-size:12px}.at-adblock-button .ad-btn{font-size:12px} } </style>
3. Pasang atau copas kode berikut ini tepat di bawah kode <body>
<div class=’ADs-BG center hidden’ id=’ST1mar’>
<div class=’at-adblock-content-wrapper’>
<div class=’at-adblock-content’>
<div class=’center’>
<div class=’logo’>
<svg style=’width:58px;height:58px’ viewBox=’0 0 24 24′>
<path d=’M8.27,3L3,8.27V15.73L8.27,21H15.73C17.5,19.24 21,15.73 21,15.73V8.27L15.73,3M9.1,5H14.9L19,9.1V14.9L14.9,19H9.1L5,14.9V9.1M11,15H13V17H11V15M11,7H13V13H11V7′ fill=’#b23939’/>
</svg>
</div>
</div>
<div class=’at-adblock-text’>
<h3>
Attention! Ad blocker Detected!
</h3>
<p>
We know ads are annoying but please bear with us here & disable your ad blocker!
</p>
</div>
<div class=’at-adblock-button’>
<button class=’ad-btn’>
Okay
</button>
</div></div></div></div>
4. Terakhir, copas kode berikut ini di atas kode </body>
<script src=’data:text/javascript;base64,ZnVuY3Rpb24gaW5pdCgpe2Fkc0Jsb2NrZWQoZnVuY3Rpb24obyl7bz8oJCgiI1NUMW1hciIpLnJlbW92ZUNsYXNzKCJoaWRkZW4iKSwkKCIuYXQtYWRibG9jay13cmFwcGVyIikuYWRkQ2xhc3MoImZhZGVJbiIpKTpjb25zb2xlLmxvZygiQWQtYmxvY2tlciBFbmFibGVkIDogIitvKX0pfWZ1bmN0aW9uIGFkc0Jsb2NrZWQobyl7dmFyIG49bmV3IFJlcXVlc3QoImh0dHBzOi8vcGFnZWFkMi5nb29nbGVzeW5kaWNhdGlvbi5jb20vcGFnZWFkL2pzL2Fkc2J5Z29vZ2xlLmpzIix7bWV0aG9kOiJIRUFEIixtb2RlOiJuby1jb3JzIn0pO2ZldGNoKG4pLnRoZW4oZnVuY3Rpb24obyl7cmV0dXJuIG99KS50aGVuKGZ1bmN0aW9uKG4pe2NvbnNvbGUubG9nKG4pLG8oITEpfSkuY2F0Y2goZnVuY3Rpb24obil7Y29uc29sZS5sb2cobiksbyghMCl9KX1zZXRUaW1lb3V0KCgpPT57aW5pdCgpfSwwKSwkKCIuYWQtYnRuIikuY2xpY2soZnVuY3Rpb24oKXtsb2NhdGlvbi5yZWxvYWQoKX0pOw== ‘/>
Itu dia Kode Script Anti-AdBlock untuk Blogger dan cara pasangnya (sumber). Jika berhasil, good luck!
Itu dia Kode Script Anti-AdBlock untuk Blogger dan cara pasangnya (sumber). Jika berhasil, good luck!
Kode Script Anti-AdBlock untuk Blogger #2
Ini dia Kode Script Anti-AdBlock untuk Blogger. Bisa dipasang di layout dan di edit HTML.
1. Layout > Add a Gadget > pilih HTML/Javascript
2. Judul Widget Kosongkan
3. Copas kode berikut ini ke kolom “Content”
<style>#g207{position:fixed;position:absolute;top:0;top:expression ((t=document.documentElement.scrollTop?document.documentElement.scrollTop:document .body.scrollTop)+"px"); left:0;width:100%;height:100%;background-color:#fff;opacity:0.9;filter:alpha(opacity=90);display:block}#g207 p{opacity:1;filter:none;font:bold 16px Verdana,Arial,sans-serif;text-align:center;margin:20% 0}#g207 p a,#g207 p i{font-size:12px}#g207 ~ *{display:none}</style><noscript><i id=g207><p>Please enable JavaScript!<br />Bitte aktiviere JavaScript!<br />S'il vous plaît activer JavaScript!<br />Por favor,activa el JavaScript!<br /><a href="http://antiblock.org/">antiblock.org</a></p></i></noscript><script>(function(w,u){var d=w.document,z=typeof u;function g207(){function c(c,i){var e=d.createElement('i'),b=d.body,s=b.style,l=b.childNodes.length;if(typeof i!=z){e.setAttribute('id',i);s.margin=s.padding=0;s.height='100%';l=Math.floor(Math.random()*l)+1}e.innerHTML=c;b.insertBefore(e,b.childNodes[l-1])}function g(i,t){return !t?d.getElementById(i):d.getElementsByTagName(t)};function f(v){if(!g('g207')){c('<p>Please disable your ad blocker!<br/>This site is supported by the advertisement <br/> Please disable your ad blocker to support us!!! </p>','g207')}};(function(){var a=['Adrectangle','PageLeaderAd','ad-column','advertising2','divAdBox','mochila-column-right-ad-300x250-1','searchAdSenseBox','ad','ads','adsense'],l=a.length,i,s='',e;for(i=0;i<l;i++){if(!g(a[i])){s+='<a id="'+a[i]+'"></a>'}}c(s);l=a.length;for(i=0;i<l;i++){e=g(a[i]);if(e.offsetParent==null||(w.getComputedStyle?d.defaultView.getComputedStyle(e,null).getPropertyValue('display'):e.currentStyle.display )=='none'){return f('#'+a[i])}}}());(function(){var t=g(0,'img'),a=['/adaffiliate_','/adops/ad','/adsales/ad','/adsby.','/adtest.','/ajax/ads/ad','/controller/ads/ad','/pageads/ad','/weather/ads/ad','-728x90-'],i;if(typeof t[0]!=z&&typeof t[0].src!=z){i=new Image();i.onload=function(){this.onload=z;this.onerror=function(){f(this.src)};this.src=t[0].src+'#'+a.join('')};i.src=t[0].src}}());(function(){var o={'https://pagead2.googlesyndication.com/pagead/show_ads.js':'google_ad_client','https://js.adscale.de/getads.js':'adscale_slot_id','https://get.mirando.de/mirando.js':'adPlaceId'},S=g(0,'script'),l=S.length-1,n,r,i,v,s;d.write=null;for(i=l;i>=0;--i){s=S[i];if(typeof o[s.src]!=z){n=d.createElement('script');n.type='text/javascript';n.src=s.src;v=o[s.src];w[v]=u;r=S[0];n.onload=n.onreadystatechange=function(){if(typeof w[v]==z&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){n.onload=n.onreadystatechange=null;r.parentNode.removeChild(n);w[v]=null}};r.parentNode.insertBefore(n,r);setTimeout(function(){if(w[v]!==null){f(n.src)}},2000);break}}}())}if(d.addEventListener){w.addEventListener('load',g207,false)}else{w.attachEvent('onload',g207)}})(window);</script>
4. Save!
Kode Script Anti-AdBlock untuk Blogger di atas juga bisa dipasang di dalam template:
- Tema > Edit HTML
- Simpan kode AdBloker di atas kode </body>
- Save!
Itu dia kode anti adblock dan cara pemasangannya yang saya kutip dari Sumber .* Semoga bermanfaat
Ini dia Kode Script Anti-AdBlock untuk Blogger. Bisa dipasang di layout dan di edit HTML.
1. Layout > Add a Gadget > pilih HTML/Javascript
2. Judul Widget Kosongkan
3. Copas kode berikut ini ke kolom “Content”
<style>#g207{position:fixed;position:absolute;top:0;top:expression ((t=document.documentElement.scrollTop?document.documentElement.scrollTop:document .body.scrollTop)+"px"); left:0;width:100%;height:100%;background-color:#fff;opacity:0.9;filter:alpha(opacity=90);display:block}#g207 p{opacity:1;filter:none;font:bold 16px Verdana,Arial,sans-serif;text-align:center;margin:20% 0}#g207 p a,#g207 p i{font-size:12px}#g207 ~ *{display:none}</style><noscript><i id=g207><p>Please enable JavaScript!<br />Bitte aktiviere JavaScript!<br />S'il vous plaît activer JavaScript!<br />Por favor,activa el JavaScript!<br /><a href="http://antiblock.org/">antiblock.org</a></p></i></noscript><script>(function(w,u){var d=w.document,z=typeof u;function g207(){function c(c,i){var e=d.createElement('i'),b=d.body,s=b.style,l=b.childNodes.length;if(typeof i!=z){e.setAttribute('id',i);s.margin=s.padding=0;s.height='100%';l=Math.floor(Math.random()*l)+1}e.innerHTML=c;b.insertBefore(e,b.childNodes[l-1])}function g(i,t){return !t?d.getElementById(i):d.getElementsByTagName(t)};function f(v){if(!g('g207')){c('<p>Please disable your ad blocker!<br/>This site is supported by the advertisement <br/> Please disable your ad blocker to support us!!! </p>','g207')}};(function(){var a=['Adrectangle','PageLeaderAd','ad-column','advertising2','divAdBox','mochila-column-right-ad-300x250-1','searchAdSenseBox','ad','ads','adsense'],l=a.length,i,s='',e;for(i=0;i<l;i++){if(!g(a[i])){s+='<a id="'+a[i]+'"></a>'}}c(s);l=a.length;for(i=0;i<l;i++){e=g(a[i]);if(e.offsetParent==null||(w.getComputedStyle?d.defaultView.getComputedStyle(e,null).getPropertyValue('display'):e.currentStyle.display )=='none'){return f('#'+a[i])}}}());(function(){var t=g(0,'img'),a=['/adaffiliate_','/adops/ad','/adsales/ad','/adsby.','/adtest.','/ajax/ads/ad','/controller/ads/ad','/pageads/ad','/weather/ads/ad','-728x90-'],i;if(typeof t[0]!=z&&typeof t[0].src!=z){i=new Image();i.onload=function(){this.onload=z;this.onerror=function(){f(this.src)};this.src=t[0].src+'#'+a.join('')};i.src=t[0].src}}());(function(){var o={'https://pagead2.googlesyndication.com/pagead/show_ads.js':'google_ad_client','https://js.adscale.de/getads.js':'adscale_slot_id','https://get.mirando.de/mirando.js':'adPlaceId'},S=g(0,'script'),l=S.length-1,n,r,i,v,s;d.write=null;for(i=l;i>=0;--i){s=S[i];if(typeof o[s.src]!=z){n=d.createElement('script');n.type='text/javascript';n.src=s.src;v=o[s.src];w[v]=u;r=S[0];n.onload=n.onreadystatechange=function(){if(typeof w[v]==z&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){n.onload=n.onreadystatechange=null;r.parentNode.removeChild(n);w[v]=null}};r.parentNode.insertBefore(n,r);setTimeout(function(){if(w[v]!==null){f(n.src)}},2000);break}}}())}if(d.addEventListener){w.addEventListener('load',g207,false)}else{w.attachEvent('onload',g207)}})(window);</script>
4. Save!
Kode Script Anti-AdBlock untuk Blogger di atas juga bisa dipasang di dalam template:
- Tema > Edit HTML
- Simpan kode AdBloker di atas kode </body>
- Save!
Itu dia kode anti adblock dan cara pemasangannya yang saya kutip dari Sumber .* Semoga bermanfaat