Log in

View Full Version : WHen adding adsense code it distorts the design


John Diver
11-26-2014, 08:45 AM
Hey,

I have added adsense, both in the breadcrumb template and in the ad_global_below_navbar template but when I do it is making the navigation move into the header.

Can anyone help with this please?
I have left it in the ad_global_below_navbar template so you can see the problem.

This is the code I am using:

<p align="center"><script type="text/javascript"><!--
google_ad_client = "ca-pub-9222821431952789";
/* ICF - Hdr 728 */
google_ad_slot = "2541901540";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>

--------------- Added 1416998770 at 1416998770 ---------------

P.s. I also did it without <p> tags

ozzy47
11-26-2014, 09:07 AM
Does it do the same thing on a unmodified default style?

John Diver
11-26-2014, 11:48 AM
Hey ozzy,

This is the only modification made on the default design, everything else is default.

Thanks :)

Dave
11-26-2014, 12:02 PM
Do you have a link to the forum where this issue is happening?

ForceHSS
11-26-2014, 12:04 PM
<a href="http://www.deuceace.com" target="_blank">http://www.deuceace.com</a>
the homepage you have set on this site is not working you need to update it

John Diver
11-26-2014, 12:04 PM
Sorry, I thought I included a link!

Http://www.InternationalChatForum.com - Just testing it out at the minute so its all default apart from this one change

Thanks

--------------- Added 1417010690 at 1417010690 ---------------

Its a new install with a database from vb 3.8 - So everything is as standard

ForceHSS
11-26-2014, 12:05 PM
the footer code is messed up revert it and the code you have above make sure you add it to the bottom of the template

default below for google ads

ad_showthread_firstpost_start

<vb:if condition="$adsense_pub_id AND CONTENT_PAGE">
<vb:if condition="!$bbuserinfo['userid']">
<div style="float:right; width:300px; height:250px; margin-left:10px">
<script type="text/javascript"><!--
google_ad_client = "{vb:var adsense_pub_id}";
google_ad_host = "{vb:var adsense_host_id}";
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = "300x250_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "{vb:stylevar alt1_bgcolor_hex}";
google_color_bg = "{vb:stylevar alt2_bgcolor_hex}";
google_color_link = "{vb:stylevar body_link_n_fgcolor_hex}";
google_color_text = "{vb:stylevar body_fgcolor_hex}";
google_color_url = "{vb:stylevar body_link_n_fgcolor_hex}";
google_ui_features = "rc:6";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</vb:if>
</vb:if>


ad_navbar_below

<vb:if condition="$adsense_pub_id AND CONTENT_PAGE">
<div style="width:728px; margin:0 auto; padding-bottom:1em">
<script type="text/javascript"><!--
google_ad_client = "{vb:var adsense_pub_id}";
google_ad_host = "{vb:var adsense_host_id}";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "{vb:stylevar alt2_bgcolor_hex}";
google_color_bg = "{vb:stylevar alt1_bgcolor_hex}";
google_color_link = "{vb:stylevar body_link_n_fgcolor_hex}";
google_color_text = "{vb:stylevar body_fgcolor_hex}";
google_color_url = "{vb:stylevar body_link_n_fgcolor_hex}";
google_ui_features = "rc:6";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</vb:if>


ad_footer_start

<vb:if condition="$adsense_pub_id AND CONTENT_PAGE">
<div class="google_adsense_footer" style="width:728px; margin:0 auto; padding-top:1em">
<script type="text/javascript"><!--
google_ad_client = "{vb:var adsense_pub_id}";
google_ad_host = "{vb:var adsense_host_id}";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "{vb:stylevar page_bgcolor_hex}";
google_color_bg = "{vb:stylevar page_bgcolor_hex}";
google_color_link = "{vb:stylevar body_link_n_fgcolor_hex}";
google_color_text = "{vb:stylevar body_fgcolor_hex}";
google_color_url = "{vb:stylevar body_link_n_fgcolor_hex}";
google_ui_features = "rc:6";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</vb:if>

John Diver
11-26-2014, 12:13 PM
Thanks for the reply, I was just trying if adsense worked on the footer, I have it reverted to the default again but its the same problem.

ForceHSS
11-26-2014, 12:14 PM
above post updated

John Diver
11-26-2014, 12:44 PM
Thanks for the reply, just wondering what the "AND CONTENT PAGE" in the code is for please.

I have reverted all templates so its back to complete default now.

I would like to have adsense on the header and footer of all pages.

Thanks for the help :)

ForceHSS
11-26-2014, 12:54 PM
have you went to members area on vb and added it yet

John Diver
11-26-2014, 03:25 PM
Sorry, I meant from the code that you posted:

<vb:if condition="$adsense_pub_id AND CONTENT_PAGE">

It seems like I'm missing something here, I always just added the adsense code into 3.8 and previous versions - Is it a setting for the publisher ID in 4?

Im pretty much just testing out 4, guess I have a lot more to learn :)

ForceHSS
11-26-2014, 03:37 PM
You need to go to members area on vb add adsense then reupload the files

John Diver
11-26-2014, 04:31 PM
No problem, thanks again

--------------- Added 1417043680 at 1417043680 ---------------

Can anyone tell me why there is google_ad_host?

What is it used for?
I searched and found a few unanswered threads asking the same on vb.com

John Diver
11-28-2014, 01:23 PM
Anyone know if its needed? Not sure what its being used for as its not in the normal adsense code

Lynne
11-28-2014, 06:49 PM
You don't know if *what* is needed? You asked why there is a google_ad_host, but I have no idea what that is - a file? a template? a what?

CAG CheechDogg
11-28-2014, 07:04 PM
Ok ....

google_ad_host is just an extra line in the javascript , you can read about it here:

http://www.mydigitallife.info/google_ad_host-host-id-in-google-adsense-ad-unit-code-and-revenue-sharing/

I wouldn't worry about it unless you are dealing with what that articles says .....