Forum Moderators: martinibuster

Message Too Old, No Replies

Multiple Google Adsense on VBAdvanced/VBulletin

How to get it working

         

Tapolyai

2:59 am on Jul 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am running the latest stable vBulletin forum and vBAdvanced portal software.

Anyone able to get multiple Google Adsense ads working on their site?

The Google ad Javascript seems to predefine some variables, and once it gets to the second ad, the information is lost/incorrect, and is not displayed.

I use a simple "box" module with the two Javascripts included in each one of the modules.

They look like this:


<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><strong>$vba_options[portal_blockbullet] <!-- Module title here -->Advertisement </strong></span></td>
</tr>
<tr>
<td class="$getbgrow" width="100%">
<center><script type="text/javascript">
<!--
google_ad_client = "pub-XXXXXXXXXXXXXXXX";
google_ad_width = 125;
google_ad_height = 125;
google_ad_format = "125x125_as";
google_ad_channel ="ZZZZZZZZZZ";
google_color_border = "578A24";
google_color_bg = "CCFF99";
google_color_link = "00008B";
google_color_url = "00008B";
google_color_text = "000000";
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
<!-- //-->
</script>
</center>
</td>
</tr>
</table>
<br />

And the second ad is :

<!-- begin Google skyscraper 120 x 600 -->
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><strong>$vba_options[portal_blockbullet] <!-- Module title here -->Advertisement </strong></span></td>
</tr>
<tr>
<td class="$getbgrow" width="100%">
<center>
<script type="text/javascript">
<!--
google_ad_client = "pub-XXXXXXXXXXXXXXXX";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_type = "image";
google_ad_channel ="YYYYYYYYYY";
google_color_border = "336699";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
<!-- //-->
</script>
</center>
</td>
</tr>
</table>
<br />
<!-- end Google skyscraper 120 x 600 -->

I would very much appreciate any help!

arrowman

10:32 am on Jul 16, 2005 (gmt 0)

10+ Year Member



I've purchased vBulletin, but haven't started using it yet. Sorry.

Are you sure there's a Javascript problem?

Sometimes Adsense just doesn't fill a second or third ad block, because it doesn't have enough targeted ads. That can happen on a forum.

Tapolyai

5:13 am on Jul 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nope.

If you notice each Google AdSense requires two pieces of JavaScript. One sets the variables, and the second one calls it.

It seems the second instance of "setting" the variables does not happen because the variables are already set. So when the second set's second JavaScript runs, the variables are from the first set - and are incorrect for what it supposed to be.

I have switched the ads back and forth, and only the first ad is displayed. No matter if it is the graphics or the text.

I have tried it in just raw HTML, just two ads, no luck.

roddy

9:11 am on Jul 17, 2005 (gmt 0)

10+ Year Member



Sorry, I think you must have some other problem. I have multiple adsense blocks on my VBulletin pages, and although I sometimes get a blank block or PSA, 99% of the time it's fine.

I've also been able to set it up to hide the ads from registered users, which is handy, and am looking at setting it up so that rather than just appearing at the top of the page, the ads appear at the correct post - ie, if the user clicks a link along the lines of /showtopic?p=41653#post41653
the ads will appear directly below / to the side of post 41653.

For maximum effect with Vbulletin, get your ads onto the archives - that's where I get my best results.

Roddy

Tapolyai

5:46 pm on Jul 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Figured it out.

There is nothing wrong with vB or VBA. It is all Google.

According to their writing, I flagged one of the blocks as "image only", since there are few and far between for image clients, they will display a simple empty block. Switching it to text/image, will display text ads if the image ads are not available.

TonysDesigns

7:18 pm on Jul 19, 2005 (gmt 0)

10+ Year Member



Hey Tapa! How are you. I have a fairly active vB 3.0.7, will be 3.5 soon, forum with around 1.5 - 2 million page views monthly and run three instances of Adsnese. Stickymail me for the url and you can see my HTML I dont' have this problem, but it might be that the inventory of ads are just not available for you.

Take care