Forum Moderators: martinibuster

Message Too Old, No Replies

Is there a way to display Adsense only if ads are available?

         

Shenron

12:43 am on Aug 6, 2005 (gmt 0)

10+ Year Member



Hello,

I wonder wheter it is possible to create a javascript function which display the Google Adsense only if ads are available and do not display when google tries to show the alternate ad?

Maybe it is possible using this code [pagead2.googlesyndication.com...] but my poor knowledge in javascript does not allow me to create such a script lol

The fact is that I display google ads in a color table so if I have no alternate ad my table is empty but still present. Therefore I need a javascript before the table to be sure that ads are available.

What do you think about it?

moltar

12:49 am on Aug 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is an option when you are getting the code for the ad -- "Alternate ad URL or color [google.com]"

Shenron

12:53 am on Aug 6, 2005 (gmt 0)

10+ Year Member



yes but look this,If you display:

Here my Ad: "Your google ad"

So if you have no ad, you will have "Here my Ad:" so I would like to know if it is possible to have something like that

<script language="javascript">
If(there_is_ad_available())
{
document.write('Here my Ad: "Your google ad"'");
}
</script>

Do you understand what I mean?

PatrickDeese

1:00 am on Aug 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Google has a free collapse script that you can download from the Adsense control panel somewhere - if there is no ad available, the unit will shrink.

Personally I prefer to monetize my ad space with either an affiliate banner, or home spun ad that sends traffic to another section of the site that has a good conversion rate.

Shenron

1:08 am on Aug 6, 2005 (gmt 0)

10+ Year Member



Thanks :)

I found the script [google.com...]