If you enjoy our website, feel free to connect with us on Google News or become a part of our Telegram Group for more updates and engaging discussions.

How to protect AdSense account from invalid clicks in Blogger

Consecutive on an Adsense ad have an impact and are a concern among publishers about the security of their Google AdSense accounts.
How to protect AdSense account from invalid clicks in Blogger

Certainly, both blogs and websites often rely on Google AdSense for monetization. One common challenge faced by publishers is the issue of invalid clicks, also known as consecutive clicks or hijacking. These activities can be deemed inappropriate, resembling acts of vandalism, and prove detrimental to the well-being of publishers.

Consecutive clicks on a Google AdSense ad can significantly impact publishers' concerns about the security of their AdSense accounts. When consecutive clicking occurs, Google AdSense interprets it as an attempt to manipulate ad redemption, and in certain instances, it may recognize it as hacking, spamming, or click bombing. While Google AdSense takes measures to delete such clicks, their occurrence can still have repercussions on both your blog and account. To mitigate these effects, it is advisable to incorporate a code snippet designed to prevent click hijacking and spam clicks.

What is clicking

Click hacking, as per Google's definition, refers to clicks that lack value for advertisers and are categorized as invalid clicks. This encompasses intentional clicks known as hijacking, as well as unintentional clicks deemed accidental. These clicks don't originate from genuine users actively searching for keywords; instead, they may result from bots or competitors. Such actions are regarded as unfair competition, akin to "dirty play," aiming to deplete an opponent's advertising budget strategically to gain an advantage in AdWords positioning.

Steps to stop invalid in Google AdSense Ads

Step 1: Go to your Blogger Dashboard > Click the Themes menu > Edit HTML > Add the below CSS snippet before the tag ]]></b:skin>.

.disabled{pointer-events:none}.hidden{display:none}

Step 2: Next, find the tag </body>.

<script>//<![CDATA[
    var disableAds = "disabled"; //Thay bằng hidden để ẩn toàn bộ quảng cáo, disabled để vô hiệu hoá click
    var maxClick = 3; //Số lượt click tối đa khi vượt quá sẽ ẩn hoặc chặn click quảng cáo
    var adsCookieEx = 1; //Cài đặt từ 1-24, thời gian người dùng được click trở lại
    function setCookie(a, b, c) {
        if (c) {
            var d = new Date();
            d.setTime(d.getTime() + adsCookieEx * 3600 * 1000);
            var e = ";expires=" + d.toGMTString()
        } else {
            var e = ""
        }
        document.cookie = a + "=" + b + e + ";path=/"
    }
    function getCookie(a) {
        var b, c, d, e = document.cookie.split(";");
        for (b = 0; b < e.length; b++)
            if (c = e[b].substr(0, e[b].indexOf("=")), d = e[b].substr(e[b].indexOf("=") + 1), c = c.replace(/^\s+|\s+$/g, ""), c == a) return unescape(d)
    }
    function setCookieAds(a, b) {
        var c = getCookie(a);
        void 0 != c && "" != c ? (ASTheCookieInt = parseInt(c) + 1, setCookie(a, ASTheCookieInt.toString(), 0)) : setCookie(a, "1", b)
    }
    function maxClick(a, b) {
        var c = getCookie(a);
        return void 0 != c && parseInt(c) >= b ? !0 : !1
    }
    jQuery(document).ready(function (a) {
        var b = "adsbygoogle",
            c = 7,
            d = maxClick,
            e = ".adsbygoogle",
            f = !1;
        maxClick(b, d) && a(e).addClass(disableAds).click(false), a(e).bind("mouseover", function () {
            f = !0
        }).bind("mouseout", function () {
            f = !1
        }), a(window).on("beforeunload", function () {
            f && (ASmaxClick(b, d) ? a(e).addClass(disableAds).click(false) : setCookieAds(b, c))
        })
    });
//]]></script>

In the provided code, you'll observe the presence of a class within the Google AdSense advertising tag. This class can be substituted with the class from the code of other ad networks, such as adsbygoogle followed by <ins>.

If your blog lacks a JQuery library, insert the following code just before the closing `</head>` tag.

<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js'/>

The provided code serves to prevent clicks and spam clicks on Google AdSense for Blogger. Although I've come across this information online, it's important to note that I haven't implemented it on my blog since I don't currently have ads. However, after testing, I can confirm that the code is effective. I highly recommend applying it to your blog for optimal results.

© Copyright:
www.itisuniqueblog.com

Success isn't an endpoint, nor is failure a definitive outcome. It's the bravery to persist that truly matters in the journey of life.

You may like these posts

Post a Comment

Enter Image URL / Code Snippets / Quotes / name tag, then click parse button accordingly that you have entered. then copy the parse result and paste it into the comment field.


Cookie Consent

We use cookies on our website to analyze traffic, enhance your browsing experience, and remember your preferences. By continuing to use our site, you consent to our use of cookies. You can manage your cookie preferences in your browser settings. For more information, please read our Privacy Policy.

Google Translate
Bookmark Post