Log in

View Full Version : Google Adsense Background Color


8thos
08-02-2011, 12:52 AM
How do I change this default vbulletin google adsense background (low settings). I inspected it in Firebug and saw no stylevar, .css class or html code for it in Templates, so is it changeable in the actual javascript code of vbulletin? Today I started using low settings in combination with Google Adsense Channels for 'Manage Ads'.

https://vborg.vbsupport.ru/external/2011/08/89.jpg

HMBeaty
08-02-2011, 01:01 AM
As far as I know, there is no way to change that background color. (I could be wrong)

8thos
08-02-2011, 01:06 AM
As far as I know, there is no way to change that background color. (I could be wrong)Where there's a will there's a way! I'll break my whole site if I have to.

HMBeaty
08-02-2011, 01:08 AM
Update: I found this: http://www.guruofsearch.com/adsense-transparent-background

Yes, it's possible, but we don't recommend it as it may prove to be a violation of your Google Adsense user agreement (or TOS = Terms of Service)

8thos
08-02-2011, 01:13 AM
Update: I found this: http://www.guruofsearch.com/adsense-transparent-backgroundI just want to change it to my site's background color.


Use solid colors instead

You might be set on the whole transparent background thing, and might actually have a situation where it looks quite good. But the bottom line is you don't want to risk having your Adsense account suspended. Instead, we'd like to point out the advantages of using solid colors for your ad backgrounds.

* Solid colors pop more, and make the Adsense text more visible.
* If you want to blend your ads, you can choose an Adsense background color that matches the background color of your website.
* In some instances, you may actually want to vary the background color of your Adsense ad, as it will make it stand out from the rest of your site content.

--------------- Added 1312256984 at 1312256984 ---------------

It's the top one in navbar template.

{vb:raw ad_location.ad_navbar_below} <---- This is where you set adsense low to high
{vb:raw ad_location.global_below_navbar} <---- That's for manage ads.

Where do I go to access this?

--------------- Added 1312315659 at 1312315659 ---------------

I have not figured this out yet but until then, I'm doing it manually.

Crotan
08-04-2011, 02:54 AM
Do they show up in your adsense account after adding them through the vbulletin integrated mod?

If they do you can change the color palette there.
(I'm pretty sure they don't)

Otherwise there is an old thread that was responded to by Steve for vb 3.8: https://www.vbulletin.com/forum/showthread.php/296765-Google-Adsense

Here are the variables you can add to your code to change specific colors:

google_color_border = "336666";
google_color_bg = "FFE6CC";
google_color_link = "000000";
google_color_text = "000000";
google_color_url = "CC0000";

Substitute your color hex codes of course.

Go into admincp -> Styles & Templates -> Search in Templates. Search for "ad" You'll see ad_navbar_below and global_below_navbar both listed along with various other ad location templates.

--------------- Added 1312434954 at 1312434954 ---------------

ad_navbar_below is the template you will want to change to customize the
A small 5-link advertising unit under the navigation bar. This location only shows text ads in the Low package.

Surprisingly the already established values in that template were
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}";

So looks like you have some stylevar hunting to do. On the other hand you could always directly change that code to my last post and it will do it all the same. However the stylevars are probably safer to update, the world won't end if you get your hex color code wrong. So i'd go with the stylevars over a direct edit of the code for this route

--------------- Added 1312435585 at 1312435585 ---------------
However

Personally I wouldn't use the vbulletin mod because of the lack of integration with your actual adsense account.

You get so much more control if you generate the code from within your adsense account. you can use custom channels and all.

What I would recommend however is altering their placement templates with your own google ad code, for the placements you want. you can pick and choose your locations rather than using the all or nothing method their integration forces with the two options

8thos
08-04-2011, 04:17 PM
Do they show up in your adsense account after adding them through the vbulletin integrated mod?

If they do you can change the color palette there.
(I'm pretty sure they don't)

Otherwise there is an old thread that was responded to by Steve for vb 3.8: https://www.vbulletin.com/forum/showthread.php/296765-Google-Adsense



Go into admincp -> Styles & Templates -> Search in Templates. Search for "ad" You'll see ad_navbar_below and global_below_navbar both listed along with various other ad location templates.

--------------- Added 1312434954 at 1312434954 ---------------

ad_navbar_below is the template you will want to change to customize the
A small 5-link advertising unit under the navigation bar. This location only shows text ads in the Low package.

Surprisingly the already established values in that template were
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}";

So looks like you have some stylevar hunting to do. On the other hand you could always directly change that code to my last post and it will do it all the same. However the stylevars are probably safer to update, the world won't end if you get your hex color code wrong. So i'd go with the stylevars over a direct edit of the code for this route

--------------- Added 1312435585 at 1312435585 ---------------
However

Personally I wouldn't use the vbulletin mod because of the lack of integration with your actual adsense account.

You get so much more control if you generate the code from within your adsense account. you can use custom channels and all.

What I would recommend however is altering their placement templates with your own google ad code, for the placements you want. you can pick and choose your locations rather than using the all or nothing method their integration forces with the two optionsThat's true but isn't the adsense code javascript built in and when adding custom adsense code you are making the site load a little longer? I found those templates but decided instead of the default 5 they give for text links I prefer 6 and because I use custom channels, I need to figure out how to ad my own custom codes to specific threads. I tried doing it by creating a replacement bb code and putting it inside the postbit with a google bot account but it made the thread load weird.

Crotan
08-04-2011, 06:06 PM
That's true but isn't the adsense code javascript built in and when adding custom adsense code you are making the site load a little longer? I found those templates but decided instead of the default 5 they give for text links I prefer 6 and because I use custom channels, I need to figure out how to ad my own custom codes to specific threads. I tried doing it by creating a replacement bb code and putting it inside the postbit with a google bot account but it made the thread load weird.

Compare the template the vbulletin included adsense mod creates to the code google will create for you. They both load javascript from google. Only difference is the vbulletin code grabs color information from stylevars where as adsense code from google will grab it from the configuration you setup in your adsense account.

I can't really help you do anything with specific threads, that might be something for another request.

The ad template to put google adsense in the first post of every thread is "ad_thread_first_post_content"

8thos
08-04-2011, 06:34 PM
K thanks man. I thought that the code they used was compressed javascript inside the vbulletin's core javascript files which makes the site faster. I was wondering is there a way to call that inside the template instead of using the whole javascript code since in-line javascript is a no-no?