Connect with us

PHP script to prevent Google AdSense click bombing

solution

PHP script to prevent Google AdSense click bombing

“God my AdSense account is disabled.I don’t know what happened.!”This was the question that i was hearing for about a month now.Yes it’s true.A lot of people are loosing AdSense account due to invalid clicks and click bombing by AdSense bots.It’ s pretty disheartening to know that the hard put efforts are lost due to somebodies unacceptable wishes.So what to do.How to prevent click bombing? How to Stop invalid clicks by AdSense bots.And finally i figured out an answer to this question.

AdSense Click Bombing – What & How

AdSense click bombing arise when Google ads are clicked many time within a given time gap by either a human or a bot.Google AdSense TOS is strictly against invalid clicks and Google have advanced infrastructure to identify any type of invalid click risen.It is almost impossible to evade the eyes of Google  According to AdSense TOS the publisher is responsible for preventing Invalids click and if any invalid clicks are generator, the whole fault is dumped into the shoulders of the helpless publishers.

Google is strict and they have explicitly told that invalid clicks could get your account banned. And if some people start to click bomb on your site ,there is nothing much you could do rather than to helplessly see the Hard earned AdSense account slipping away from your hands.

There have been a lot of people who has lost their AdSense account due to this terrible vex. And when you know that they are the topmost bloggers, you will realize how hard the situation has become.

READ  Removing NoFollow From WordPress Comments

How to Prevent AdSense Click Bombing using a PHP Script?

I was damn afraid of loosing my AdSense account. It was a necessity to develop a script that could prevent AdSense click bombing. Hence i came up with the below php script to stop AdSense invalid clicks.

Step 1: Register an Account at Statuscounter
Status counter will ensure that the ip of the visitors reaching your sites are noted. And you can check from which IP you are getting More frequent hits [ 25+ or so-be logical].

Note down the Ip addresses. Now look at the script below.

Step 2: Add this at the top of your WordPress with all the IPs you have taken from the stat counter.

<?php
$ip = $_SERVER["REMOTE_ADDR"];
$ip_array = array("xxx.xxx.xxx.xx", "xxx.xxx.xxx.xx", "xxx.xxx.xxx.xx", "xxx.xxx.xxx.xx", "xxx.xxx.xxx.xx");
?>

Then on all the AdSense codes replace with the following:

<?php
if (in_array($ip, $ip_array)) {
echo 'Blocked Adsense';
}
else {
echo '<Here comes the adsense code>';
}
?>

This script will block AdSense ads to those IP address that you have mentioned in the script there And will only show an unclickable ad to those Click Bombers. This way you can prevent AdSense click bombing.

Continue Reading
You may also like...

We are a WordPress plugin developer company that focuses on useful WordPress plugin creation and empowering people to earn passive incomes from their blogs. We build unique and groundbreaking plugins that will revolutionize your blog!

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

More in solution

    Sign up for our newsletter and get a free affiliate e-book!


    About Me:

    Teodor Coste

    Hi, my name is Szabi and I'm documenting my journey selling plugins on CodeCanyon. I will show you every step of it: learning to code, plugin ideas, WordPress stuff and more. Read more…

    Mega Plugin Bundle:

    CodeCanyon Portfolio:

    Learn to Code Plugins:

    Latest Promotions:

    Recommended Theme:

    Start Your Own Blog:

    Recommended VPN:

    Translate Your Blog:

    AdSense Alternative:

    Best Article Spinner:

    Popular Posts:

    Latest Posts:

    To Top

    Privacy Preference Center

        Necessary

        Advertising

        Analytics

        Other