GIDNetwork > Testing AdSense on a web page - the right way
Register
« How Does a Credit Card Transaction Get Processed? Still working on the BBCodes... »

Testing AdSense on a web page - the right way

by: JdS - May 07, 2005

When I began testing and designing the layout of the web pages here at www.gidnetwork.com, I wanted to preview different AdSense ad units on the various layouts, especially the wider ad formats I have not used anywhere else on my existing web sites.

I was particularly interested in the Medium Rectangle (300 x 250) ad format since it's also one of the few formats through which image ads are also available.

I searched the Net for information on how to do this the right way - I found nothing useful. Searched the Google AdSense Programme Policies and found this little note telling me what I already knew:

Site Functionality

Your site must not contain broken links and must be launched, functioning, and easily navigable.


n.b. I highlighted the relevant bits.

Since we cannot display AdSense ads on web pages that are "under construction" or as yet incomplete, I was seriously contemplating creating fake AdSense-y type banners in the various sizes that I was interested to view on my test layouts... Somehow, that didn't sound like a really good idea at the time and I forced myself to write a little email to the AdSense Support Team.

What a good idea that turned out to be - they replied (in their usual prompt manner) with a really simple solution to my problem.

Regular AdSense Code Example

To test AdSense ads on your pages, all you have to do is insert one line in the regular AdSense javascript code!

Let's say your AdSense code generally looks like this:

Generic Code Example:

<script type="text/javascript"><!--
google_ad_client = "pub-0000000000000000";
google_alternate_color = "ffffff";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="0000000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

ADD: google_adtest

The first step is to add a line to that code, we will add the google_adtest variable to the code:

Generic Code Example:

google_adtest = "on";

AdSense Code for TESTING

So there you have it, AdSense code for you to test your web designs and test layouts! Once you've made the necessary changes your test AdSense ad code may look a lot like this:

Generic Code Example:

<script type="text/javascript"><!--
google_adtest = "on";         // new line
google_ad_client = "pub-0000000000000000";
google_alternate_color = "ffffff";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel = "0000000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

I must admit that this information spawned quite a few new and useful ideas. I'll post details in a future post perhaps...

Would you like to comment? This story has been viewed 80,676 times.
« How Does a Credit Card Transaction Get Processed? Still working on the BBCodes... »

__top__

Copyright © GIDNetwork™ 2001 - 2025

Another website by J de Silva

Page generated in : 0.00535 sec.