Protect your Adsense site against thieves

In this review we will present two small (free) scripts aimed at protecting your website against Adsense stealing.

Yes that exists. Once a hacker is able to enter your website and change something in your files, he can start to change the client code on you ads and make incomes with your traffic. I have read such complaints in forums: "My incomes suddenly decrease, they are near zéro! what happens?".

The answer is: verify the code client code on your ads.

The Adsense administering panel provides functions to impeach ads with your client code to be displayed on other websites, but there is not mean to empeach ads with client code of others to be displayed on your website (for now).

If the hacker is dumb, he does change the code on all ads to make a maximum of money and he will be discovered quickly, but if he is smart it may by more difficult to detect the hacking.

Suppose the thief enters on you website each night, when you are sleeping, change the Adsense client code with some script (they are very capable to write such scripts when a lot of money is at the end of the road) and at the aurora, comes again to your website and changes again the code to restore your client code. You will observe a drop in revenues but never you will know where is the origin of that.

To protect you against such hacking, two free PHP scripts are provided on, under the Mozilla or GPL license:

Adsense Code Checker.

This tool scans your website (nothing is written on the site), for all pages and extract the Adsense code from the JavaScript code. At the end of the process the list of client codes found is displayed. You should see here only your client code otherwise there is a problem!

Script Checker.

This program is aimed against smart hackers that could store some scripts on your website to change the content when they need. All the scripts on the site are compared with the original sources on a local directory on your computer. And also scripts (or other files) that are found on the site and not in the local source directory are also detected. Once again, nothing is written on the site.

With this two tools you should be able to protect your website against hackers. Run them from time to time, at different hours and any hacking will be surely detected.

Adsense Adsense tutorial - Ajax and Adsense - Thing to avoid - Adsense behaviors - Tips - Adsense code checker - Advertising FAQ - Glossary