게임, 그 끝없는 이야기의 시작.

게임에 관한 모든 이야기를 담은 블로그입니다. 새로운 게임 정보는 물론, 전략, 팁, 리뷰와 같은 다양한 콘텐츠를 통해 여러분과 함께 게임의 이야기를 나눕니다.

블로그

광고 차단 프로그램 차단 감지 무효화 안티 애드블록 스크립트

gameabout 2020. 11. 12. 21:48

티스토리 블로그는 대부분이 애드센스 승인 후 광고 노출로 인한 수익이다. 하지만 광고 차단 프로그램을 설정하고 블로그에 방문하는 사람들을 종종 볼 수 있다. 이는 애드센스 광고 수익을 저하시키는 원인 중 하나이다. 그렇다면 이를 방지 할 수 있는 방법은 없을까? 본인의 약간이나마 광고 수익 창출을 위해 아래 글을 참고 하도록 하자.

 

광고 차단 프로그램


물론 본인들의 PC에 광고 차단 프로그램이 설치된 것을 알고 있는지 모르는지 알 길은 없으나 취미로 블로그를 하면서 소소한 수익을 얻고자 적게는 한 시간에서 많게는 세시 간 이상 글을 작성한다.

 

하지만 광고 차단 프로그램으로 인해 그나마 있던 0.1~0.12 USD 미미한 수익도 사라지게 된다. 그야말로 비효율적인 본업 외에 자신만의 시간을 버리는 것이 되며 상당히 허무함의 연속이다.

 

특히나 글쓴이의 블로그의 경우 소위 말하는 돈 안되는 게임 관련 블로그인 데다가 젊은 층의 성인 남자 20대, 30대가 주방 문자로 그만큼 PC나 모바일 기기에서 광고 차단 프로그램을 설치하고 방문할 확률이 높다는 것이다.

 

안티 애드블록


AdBlock

그래서 어쩔 수 없이 해당 블로그에는 혹시 모를 광고 차단 프로그램 해제 안내 문구를 표시해주는 안티애드블록 스크립트를 추가하게 되었고 해당 스크립트는 다음과 같으며 본인들이 운영하는 블로그에 적용하고 싶다면 아래 코드 블럭을 참고하도록 하자.

 

하지만 이 스크립트가 완벽하게 애드 블럭을 하는 것은 아니고 기술적인 난이도가 낮은 스크립트이기 때문에 무력화도 가능하다는 점 참고하시기 바란다.

 

해당 스크립트는 <body></body>사이에 넣고 [스킨 편집] - [파일 업로드]에서 본인이 원하는 광고 차단 관련 이미지를 업로드할 수 있으며 스크립트 내용 중 displayMessage에서 이미지 주소를 넣어주면 되는데 혹시 몰라서 해당 스크립트를 입력한 텍스트 파일도 함께 첨부하였다.

 

adblock.txt
0.01MB

 

<div id="h237">
    <span>Please Enable JavaScript!<br />Mohon Aktifkan Javascript!<a href="http://www.enable-javascript.com/">[ Enable JavaScript ]</a></span></div>
<script>
    window.document.getElementById("h237").parentNode.removeChild(window.document.getElementById("h237"));
    (function(l, m) {
        function n(a) {
            a && h237.nextFunction()
        }
        var h = l.document,
            p = ["i", "s", "u"];
        n.prototype = {
            rand: function(a) {
                return Math.floor(Math.random() * a)
            },
            getElementBy: function(a, b) {
                return a ? h.getElementById(a) : h.getElementsByTagName(b)
            },
            getStyle: function(a) {
                var b = h.defaultView;
                return b && b.getComputedStyle ? b.getComputedStyle(a, null) : a.currentStyle
            },
            deferExecution: function(a) {
                setTimeout(a, 250)
            },
            insert: function(a, b) {
                var e = h.createElement("span"),
                    d = h.body,
                    c = d.childNodes.length,
                    g = d.style,
                    f = 0,
                    k = 0;
                if ("h237" == b) {
                    e.setAttribute("id", b);
                    g.margin = g.padding = 0;
                    g.height = "100%";
                    for (c = this.rand(c); f < c; f++) 1 == d.childNodes[f].nodeType && (k = Math.max(k, parseFloat(this.getStyle(d.childNodes[f]).zIndex) || 0));
                    k && (e.style.zIndex = k + 1);
                    c++
                }
                e.innerHTML = a;
                d.insertBefore(e, d.childNodes[c - 1])
            },
            displayMessage: function(a) {
                var b = this;
                a = "abisuq".charAt(b.rand(5));
                b.insert("<" + a + '><img src="https://tistory3.daumcdn.net/tistory/624676/skin/images/kakaoADblock.jpg" height="350" width="699" alt="앗!" />죄송하지만.. 광고 차단을 사용중인 것 같아요!<br>항상 좋은 글을 쓰기 위해 노력하고 있습니다! <br>더 좋은 블로그를 위해 지원 부탁 드립니다.<br>광고 차단 해제 리스트에 제 블로그를 추가하시고 새로고침(F5)키를 눌러주세요. <br><a href="JavaScript:window.location.reload()">[ 새로고침 ]</a>' + ("</" + a + ">"), "h237");
                h.addEventListener && b.deferExecution(function() {
                    b.getElementBy("h237").addEventListener("DOMNodeRemoved", function() {
                        b.displayMessage()
                    }, !1)
                })
            },
            i: function() {
                for (var a = "DivTopAd,ad-zone-1,ad_190x90,ads-sticky,iqadtile5,leftframeAD,tobsideAd,ad,ads,adsense".split(","), b = a.length, e = "", d = this, c = 0, g = "abisuq".charAt(d.rand(5)); c < b; c++) d.getElementBy(a[c]) || (e += "<" + g + ' id="' + a[c] + '"></' + g + ">");
                d.insert(e);
                d.deferExecution(function() {
                    for (c = 0; c < b; c++)
                        if (null == d.getElementBy(a[c]).offsetParent || "none" == d.getStyle(d.getElementBy(a[c])).display) return d.displayMessage("#" + a[c] + "(" + c + ")");
                    d.nextFunction()
                })
            },
            s: function() {
                var a = {
                        'pagead2.googlesyndic': 'google_ad_client',
                        'js.adscale.de/getads': 'adscale_slot_id',
                        'get.mirando.de/miran': 'adPlaceId'
                    },
                    b = this,
                    e = b.getElementBy(0, "script"),
                    d = e.length - 1,
                    c, g, f, k;
                h.write = null;
                for (h.writeln = null; 0 <= d; --d)
                    if (c = e[d].src.substr(7, 20), a[c] !== m) {
                        f = h.createElement("script");
                        f.type = "text/javascript";
                        f.src = e[d].src;
                        g = a[c];
                        l[g] = m;
                        f.onload = f.onreadystatechange = function() {
                            k = this;
                            l[g] !== m || k.readyState && "loaded" !== k.readyState && "complete" !== k.readyState || (l[g] = f.onload = f.onreadystatechange = null, e[0].parentNode.removeChild(f))
                        };
                        e[0].parentNode.insertBefore(f, e[0]);
                        b.deferExecution(function() {
                            if (l[g] === m) return b.displayMessage(f.src);
                            b.nextFunction()
                        });
                        return
                    }
                b.nextFunction()
            },
            u: function() {
                var a = "ad&adv_keywords=,-page-peel/,/adchain.,/adfootright.,/adsxml/ad,/adyard300.,/impopup/ad,/loadadsparam.,/meme_ad.,_adshare.".split(","),
                    b = this,
                    e = b.getElementBy(0, "img"),
                    d, c;
                e[0] !== m && e[0].src !== m && (d = new Image, d.onload = function() {
                    c = this;
                    c.onload = null;
                    c.onerror = function() {
                        p = null;
                        b.displayMessage(c.src)
                    };
                    c.src = e[0].src + "#" + a.join("")
                }, d.src = e[0].src);
                b.deferExecution(function() {
                    b.nextFunction()
                })
            },
            nextFunction: function() {
                var a = p[0];
                a !== m && (p.shift(), this[a]())
            }
        };
        l.h237 = h237 = new n;
        h.addEventListener ? l.addEventListener("load", n, !1) : l.attachEvent("onload", n)
    })(window);
</script>