Forum Moderators: martinibuster
Use PHP (or ASP, whatever) for an include file to display AdSense ads.
The logic would be
if ($ip_address!= my.ip.add.ress) {
... display adsense code ...
{
If your IP address changes you could have PHP do the following:
$host_name = gethostbyaddr($_SERVER['REMOTE_ADDR']);
and then replace $ip_address in the code above with $host_name and replace my.ip.add.ress with the hostname supplied.
<added>
The thread Arran provided has better examples
</added>
This is simple... Use PHP (or ASP, whatever)...
And what if you don't use PHP (or whatever)? Not so simple?
This neat trick was suggested in another forum thread: Add the following line to your system's hosts file:
127.0.0.1 pagead2.googlesyndication.com
I tried that on one of my Windows ME systems. Didn't work for some reason. Maybe it had something to do with the file format, file name, or location, or some other deep Windows mystery (a rogue registry entry perhaps?). The poster gave the precise location of the hosts file on Windows XP systems. Trouble is, there are many versions of Windows still in use. I myself use Windows ME and Windows XP (also Linux). I had to research the Net to find the location of the hosts file on Windows ME systems.
I just tried the localhost (127.0.0.1) trick on one of my Linux systems. Works great! [um, see below] But only because I have set my nsswitch.conf file "properly" to hit "files" before "dns". On a "misconfigured" Linux (or any other Unix-like) system, the localhost trick would appear to be broken...
... Just checked another page... and another... The localhost trick blocks the Ad Links impression, but for some reason it is not blocking the Adsense vertical banners on the checked pages. Why?
You would have thought that Google could come up with something...
Indeed.
With so many systems out there, with so many ways we serve pages, with so many ways to miss some vital configuration tweak, with such widely varying levels of publisher technical ability--our fixing this is not so simple.
If Google's sophisticated techniques and algorithms can discount publisher "impressions fraud," why can't they also discount publisher "click fraud"?
There should be a simple, straightforward, universally applicable, and officially sanctioned way for Google to screen publishers viewing their own CPMed pages and accidentally clicking on their own CPC ads.
There is a very simple solution: Use Firefox and activate the option "AdBlock" and won't you see any ads.
But what if, for reasons of needing to check your ad layouts (Adsense and affiliate), you don't want the ads to totally disappear?
Another thing for my todo list: Reconfigure my CMS to serve blank (and tagged) rectangles of the appropriate sizes from my test web server. Also, set up a Windows system just for viewing my pages on that (private) network segment. (IE still usually displays pages better than the Linux alternatives.)
But it's still a pain to have to jump through all these hoops just to protect myself against possible purported "impressions fraud" and (accidental) "click fraud".