GIDNetwork > AdSense, now you can click them on your site
Register
« Still working on the BBCodes... Windows XP64 Professional »

AdSense, now you can click them on your site

by: JdS - May 18, 2005

I have been with Google's Google AdSense for Content programme since June 2003, so almost 2 years ago, today. AdSense is a hugely popular & successful programme by the way. One of my pet peeves about the programme however, is that as a web publisher, I may not click on the ads off my own web sites or on those ad units that contain my publisher ID. Which kinda makes sense, I suppose...

I don't know about you, but sometimes, some of these ads really make me curious enough to want to click on them. Like for instance, the time I was considering putting my sites on a dedicated server and I see one of those $49 dedicated server hosting deals and offers that appear once in a while on my web hosting forum pages - it was hard for me to resist clicking on the ad.

Sure, I could use the AdSense Preview Tool like everybody else - but I simply loathe the idea of installing every little computer program on my PC unless it's absolutely necessary.

I was hoping for something simpler, something that will allow me to click on AdSense ads that interests me on my own web pages and not worry about getting booted out of the programme for "invalid clicks" or worse, have the advertiser "pay me" for my curiosity and interest.

I searched the Net for a long time looking for that "brilliant idea" I was sure I would find. I even lurked for a while at popular webmaster communities discussing AdSense specifically.. all in vain!

Everyone was suggesting blocking the ads completely; either by (my) IP (and some server-side scripting) or by editing the HOSTS file on my PC. Neither sounded very efficient, since ads are completely blocked from even being displayed 8O

The Idea

Recently, the Google AdSense support team sent me some AdSense Code for Testing, allowing me to place them on as-yet-incomplete web pages online. They also said:

Further to your email, advertisers will not get charged for any clicks that are made on these ads. Additionally, once you have this ad code on your site, you can click on the ads without running the risk of having your account disabled...

That was the "brilliant idea" I was looking for... The only thing I asked myself then was, How would I write the script to handle displaying the (test) code just for me, when I surf my own pages?

AdSense for me, on my website

In other words, if I, the webmaster of this web site, were to visit this site and view the HTML markup off this page, the AdSense javascript will most certainly look like this (note line number 2):

Generic Code Example:

<script type="text/javascript"><!--
google_adtest = "on";           // line no.2
google_ad_client = "pub-0000000000000000";
google_alternate_ad_url = "http://www.gidnetwork.com/alt-300.html";
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = "300x250_as";
google_ad_type = "text_image";
google_ad_channel ="0000000000";;
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "000000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

AdSense for everybody else

But everyone else visiting this page will find the regular AdSense javascript code i.e.:

Generic Code Example:

<script type="text/javascript"><!--
google_ad_client = "pub-0000000000000000";
google_alternate_ad_url = "http://www.gidnetwork.com/alt-300.html";
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = "300x250_as";
google_ad_type = "text_image";
google_ad_channel ="0000000000";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "000000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

It didn't take me very long to plan and write the PHP script that allows me to do this with any page off my sites:

Step 1
I had to create a special page where I can set a no_adsense_for_me cookie for myself.

Step 2
Next, I had to create a custom PHP function (or 2) that will check for this cookie and return the AdSense javascript code accordingly. i.e. If the no_adsense_for_me cookie is found, show the AdSense TEST code; if not, show a regular AdSense ad-unit complete with my publisher ID and other unique values.

Anyway, now I am no longer worried about clicking on AdSense ads on my site(s) - even accidentally. I am at peace! :D

Would you like to comment? This story has been viewed 7,312 times.
« Still working on the BBCodes... Windows XP64 Professional »

__top__

Copyright © GIDNetwork™ 2001 - 2017

Another website by J de Silva

Page generated in : 0.00982 sec.