Protect yourself from invalid Adsense clicks

Have you also heard of those horror stories of Google banning Adsense accounts for the smallest mistakes?

You have read the Terms and Conditions and you know the basics but what do you do when you show your friend your site on your computer and the first thing he does is to click the Adsense ad on your site? (actual example). Well you email Google Adsense and explain what happened, it will usually be no problem.

I recently made a WordPress CMS with Adsense and I have one staff working on it as well as other people, adding text and so on on many domains. The risk to click by mistake is very big …

So I made this script

Add this at the top with all the IPs you have used to login to your Adsense account:

<?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", "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>';
}
?>

That will display “Blocked Adsense” instead of Adsense on those computers with the same IPs you used to login to your Adsense account and you don’t need to worry. On my CMS I made it to display non-clickable images of Adsense instead that looks just like Adsense so it doesn’t look weird when my staff and writers looks at the sites.

If all else fails, check out the AdSense Reinstatement Guide.

20 responses » Leave a comment
  1. Brian Pratt said on February 14, 2007 at 12:21 am

    Hi Jim

    Nice tip thanks.

    Another option is to install an adserving script like openads (http://www.openads.org/).

    There is a GEOIP file available which will allow you to not show ads to particular countries or even cities.

    Some hosts have this script as part of their fanastico build.

    You then just serve adsense with the script & all is taken care of.

    It also has other options like only showing an ad to a user once every 30 seconds or only showing an ad max 3 times to a visitor in one day etc.

    Hope this helps
    Regards
    Brian

  2. Jim Westergren said on February 14, 2007 at 1:28 pm

    Thanks Brian, that could be useful for more advanced uses.

    Another use is to not serve ads to those coming from social network siteso to increase the vote percantage.

  3. Maki said on February 16, 2007 at 12:07 am

    Thanks for the great tip. Was previously using the greasemonkey script for preventing accidental clicks but this works just as well.

  4. Thermage said on February 18, 2007 at 5:57 pm

    A very interesting site, I think. The Idea of Technology was new for me but worth to be read and thought abot it (although I’m not a native english-speaker and have some difficulties whith this language)

  5. eli said on February 19, 2007 at 12:41 pm

    simple but very useful tips. thanks

  6. Australia immigration said on March 26, 2007 at 8:55 am

    your method can only apply to the lease line or fix IP address, for those who is not using fixed IP address to go online, It may be useless. I found using adlogger will be an better solution because it can block the range of the IP address for example 60.xxx.xxx .

    what do you think ? :)

  7. Michael said on March 26, 2007 at 11:42 am

    You could also install adlogger. There you can also add ips to a list so that ads are not shown for people who visit your website with these ips.

  8. Strafverteidiger Freiburg said on May 2, 2007 at 1:58 pm

    Very great info. i will protedt us now as well.

  9. my conversations with adsense team said on June 5, 2007 at 11:16 am

    well I don’t think we need to be as much careful about accidental clicks.The adsense team knows that this could happen.I have myself consulted adsense for this purpose.You can see my full conversation with the adsense support team.

  10. Dog said on June 28, 2007 at 10:48 pm

    It is very helpful tip!

    Thank you very much!

  11. ODLS said on October 24, 2007 at 6:36 pm

    One of the biggest worries for webmasters if you get banned for something that was really unintentional. Thanks for the tip.

  12. Aelizia said on November 5, 2007 at 11:11 am

    Hi,
    Its a useful tip.Actually i am looking information regarding Adsense click and i am glad i found your blog.I am going to use this Adsense script right now. Thanks for the valuable information.

  13. youtube said on December 14, 2007 at 8:57 am

    Thanks Brian, that could be useful for more advanced uses.

    Another use is to not serve ads to those coming from social network siteso to increase the vote percantage.

  14. Bob Mill said on December 19, 2007 at 8:55 pm

    This is very useful script! I will post it on my website - check it out at http://www.ad-sensing.com

  15. Google Horror Stories said on March 21, 2008 at 4:02 pm

    That is a nice tip.. But what would be even better is if google would just ignore clicks generated by the adsense publisher.. And ignore clicks from obvious click bomb attacks.. Google is supposed to be a tech leader and they cannot do this? All they can do is ban adsense publishers for simple mistakes like accidentally clicking on their own ad. Give me a break..

  16. Don said on April 1, 2008 at 4:29 am

    Hi Jim,

    Cool idea! If someone wanted to take it a step further and actually block ad views and even page views by using cookies and IP tracking they could get a script like AdSenseClickLock from http://www.AdsenseClickLock.com.

    The script is very easy to install and can help prevent invalid clicks and potentially save an account from getting banned.

    Thanks,

    Don

  17. Ealtamira said on June 4, 2008 at 10:00 am

    Nice trick, but I don’t think adsense was so evil

  18. Patrick said on July 26, 2008 at 11:40 pm

    Personally, I prefer to use Firefox with the Adblock Plus plugin. The big advantage is, that I do not use to put the two class B subnets of my provider in that array ;) and can easily check, if ads and content match.

RSS feed for comments on this post or Track with co.mments

Leave a Comment

To quote: <blockquote>text to quote</blockquote>

Link to This Page

If you found this page useful, consider linking to it.
Simply copy and paste the code below into your web site (Ctrl+C to copy)
It will look like this: Protect yourself from invalid Adsense clicks

Pingbacks
  1. [...] But wouldn’t be nice if you weren’t clickbombed in the first place?  Thats where code such as this by Jim Westergren comes into handy.  This code will limit multiple clicks by IP and shut down your click bomber before he gets a chance.  The problem is that this can shut down legitimate clicks.  Do you have code that you use to protect your Google Adsense account, feel free to share! [...]

    Pingback by Protect your Adsense account from Invalid clicks — December 19, 2007 @ 7:49 pm

  2. [...] For more info see the source [...]

    Pingback by Top of Review ’s » Protection from invalid Adsense clicks — February 12, 2008 @ 4:05 am



Post Navigation by Category

Previous post in category: Stop the Topsites Spam!

Next post in category: Checklist when won a web site auction