Turbulent Sky
Tech Tips, Tricks and Solutions

by

Google AdSense for Content and AdSense for Search allow you to create a custom color palette so that the ads can blend or contrast with your page’s color scheme. However, for some reason, the custom color palette can’t be selected for Referrals ads. So, I added the color definitions to the ad code manually.

  1. After creating the Referrals ad, copy and paste the ad code as you normally would. For example, your code might look like the following
    <script type="text/javascript"><!--
    google_ad_client = "pub-xxxxxxxxxxxxx";
    google_ad_width = 250;
    google_ad_height = 250;
    google_ad_format = "250x250_as";
    google_cpa_choice = "CAEadPE0aicm8BvfUaU";
    //--></script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
  2. Next, add the color codes in the section where all the “google_ad_” variables are. Here’s the same example with the colors added:
    <script type="text/javascript"><!--
    google_ad_client = "pub-xxxxxxxxxxxxx";
    google_ad_width = 250;
    google_ad_height = 250;
    google_ad_format = "250x250_as";
    google_cpa_choice = "CAEadPE0aicm8BvfUaU";
    
    /*** Custom colors ***/
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "336699";
    google_color_text = "333333";
    google_color_url = "336699";
    //--></script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
  3. Edit the google_color_border (ad border), google_color_bg (background), google_color_link (link/ad title), google_color_text (ad description) and google_color_url (URL text below description) values to the desired colors.

Note that these color codes exist for Content and Search ads. I don’t know why the Referrals ad generator left them out. A person posted on the AdSense Help group that a few months ago, he/she was able to select a custom palette from the generator and asked why it no longer worked. There was no answer yet, so I did this workaround to make the Content and Referrals ads look the same.

Post a comment

5 Comments

  1. Gabriel Patiño says:

    Hi,

    do you know if it’s possible to change backround colors for even/odd rows?

    Thanks

  2. PeterRidge says:

    Hi Gabriel. Not that I know of. These are the only color parameters that I’ve seen.

  3. nigel nix says:

    I have implemented the color code and it works fine…but is it ok to screw around with google code…even a little…aren’t they supposed to be ruthless?

  4. PeterRidge says:

    Hi Nigel. These are all legitimate color codes that Google makes available for the other forms of AdSense ads. So, nothing screwy going on here. I’ve seen other posts in the Google groups that it’s OK. However, if you’re unsure, it’s best to check with Google.

  5. arwebz says:

    thanks for your great info.
    hope it can works

Post Comment

Please note: Comments are moderated by an Admin and may not be publicly visible right away.


Creative Commons License This work by Peter Ridge is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License.
Turbulent Sky Theme by Peter Ridge, based on BlueMod Theme by FrederikM.de