1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Make your AdSense blocks stand out!

Discussion in 'Placement / Reviews / Examples' started by JamesColin, May 27, 2006.

  1. #1
    Embellish Ad units and Link units without fear of empty blocks.
    A nice way to increase the CTR of Link units and Ad units while making sure that you don't have any page with an empty AdSense block: use collapsing units script as a base for further Javascript actions.

    Have you ever thought of doing something beautiful with your AdSense blocks?

    I'm sure many of you now know about the "images next the ads" which increase your CTR everytime, some of you who don't allow Public Ads to display when there isn't enough ads in Google's inventory to display on your page may know about collapsing units which can hide empty AdSense blocks and re-gain the space in your page.

    Well, the html file that Google provides you with can be adapted to do more things than hiding the AdSense block, for example it can hide additional HTML elements if the AdSense block is empty, or show hidden elements waiting to be activated via JavaScript.

    I would like to provide you with a very simple example on this page.

    At the top of this article you should see a Link unit accross the page size 728x15
    On the top of this Link unit there is this graphic:
    [​IMG]

    Well, if you don't see this Link unit, it means there is no ads to display for this article and you should not see the graphic above, how is this possible?

    Simple, I use a DIV around the graphic and the AdSense block, which I've named id="google_ads_adlink" and then in the AdSense code I use as google_alternate_ad_url this file :

    http://www.senserely.com/google_adsense_script_adlink.html (right click to download it)

    Here is an extract of the code for setting up your AdSense block :

    
    <div id="google_ads_adlink">
    <img src="http://www.senserely.com/images/bg-adlink.gif" width="751" height="10" />
    <div style="background-color: #f3a84e; width:728px;">
    <script type="text/javascript"><!--
    google_ad_client = "pub-XXXXXXXXXXXXX";
    google_alternate_ad_url = "http://www.senserely.com/google_adsense_script_adlink.html";
    google_ad_width = 728;
    google_ad_height = 15;
    google_ad_format = "728x15_0ads_al";
    google_color_border = "f3a84e";
    google_color_bg = "f3a84e";
    google_color_link = "000000";
    google_color_url = "000000";
    google_color_text = "000000";
    //--></script><script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></div></div>
    
    Code (markup):
    You can see that the IMG tag is withing the DIV id="google_ads_adlink" and so will be hidden in case there is no Adlink to display... Here is the code for the alternate url which contains the javascript to hide the DIV id="google_ads_adlink" :

    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title></title>
    <script type="text/javascript">
    var w = window;
    if (w.parent.document.getElementsByName) {
      var google_ad_frames = w.parent.document.getElementsByName("google_ads_frame");
      var google_ads_adlink = w.parent.document.getElementById("google_ads_adlink");
      for (var i = 0; i < google_ad_frames.length; i++) {
        var f = google_ad_frames[i];
        if (f.contentDocument) {
          if (w.document == f.contentDocument) {
            f.height = f.width = 0;
            google_ads_adlink.style.display="none";
          }
        } else if (f.contentWindow) {
          if (w == f.contentWindow) {
            f.height = f.width = 0;
            google_ads_adlink.style.display="none";
          }
        } 
      }
    }
    </script>
    </head>
    <body style="background-color: transparent;">
    </body>
    </html>
    
    Code (markup):
    Here you go, enjoy this example and other ideas you can come up with and if you have any question to ask please do so in this thread or on the article's comment form.
    For those who would of course want to ask if it is allowed by AdSense's ToS, yes it is, so please don't ask why it is. :D
    If you like this AdSense tip and would like to share it with other AdSense publishers then please digg it but if you prefer not to tell too many people about it then don't :)
     
    JamesColin, May 27, 2006 IP
    corinaw and rewlie like this.
  2. Dekker

    Dekker Peon

    Messages:
    4,185
    Likes Received:
    287
    Best Answers:
    0
    Trophy Points:
    0
    #2
    it looks bad..and i'm pretty sure this is against TOS
     
    Dekker, May 27, 2006 IP
  3. FuzzyLogic

    FuzzyLogic Active Member

    Messages:
    189
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Have you ever thought about being banned from Adsense for modifying the code?
     
    FuzzyLogic, May 27, 2006 IP
  4. tonyinabox

    tonyinabox Peon

    Messages:
    1,988
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think adlink unit look like site navigate already, just put where the navigate should be that got a lot of attention.

    well it might be a good tip for other people!
     
    tonyinabox, May 27, 2006 IP
  5. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #5
    SVZ I already answered that point in the last sentence of my post.
    For people who don't believe me (it means you are careful, which is a good thing, you're not jumping on any dirty trick) then look at this thread and particularly my post:
    http://forums.digitalpoint.com/showpost.php?p=875583&postcount=7

    That's in this AdSense minded WordPress template that I saw the tabs graphics for the first time, I had already worked out the alternate_url javascript for other applications (a drop shadow under an AdSense block for example)
    A quick look at the mentionned template's homepage today confirms it:

    "
    Good news everyone!

    Google AdSense Team has replied, below is the content of th email :-

    Hello Bryan,

    Thanks for your email. After reviewing your theme, I’ve found that it’s currently acceptable by our policies.

    For additional questions, we encourage you to visit our AdSense Help Center at https://www.google.com/support/adsense . If you’re unable to find an answer there, please feel free to reply to this email.

    Sincerely,

    Arlene
    The Google AdSense Team

    So, it’s now confirmed that Ads Minded theme is 100% compliant with AdSense TOS and safe to be used!
    "

    Fuzzylogic yes of course I've thought of that and that's why I'm doing that, this is not modifying AdSense code.
    You can put pretty much what you want in the alternate_url field, they give you a sample code for hidding the ads because otherwise under 0.001% of adsense publishers could come up with this javascript, but they don't say not to modify THAT code.

    tonyinabox the point of this thread is not so much the tabs-looking adlink, it's more about using the collapsing unit script as a base for doing more things than just hidding the empty adsense blocks. Then it's up to you to come up with something adapted to your sites.

    Hope this helps, is it clearer now why it's ok to use this tip?
     
    JamesColin, May 27, 2006 IP
  6. Amin

    Amin Peon

    Messages:
    123
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Great! I'm going to implement this one.
     
    Amin, May 28, 2006 IP
  7. rewlie

    rewlie Active Member

    Messages:
    937
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    58
    #7
    a mind of an inventor, great :), one point for you wwwsenserelycom
     
    rewlie, May 28, 2006 IP
  8. FuzzyLogic

    FuzzyLogic Active Member

    Messages:
    189
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #8
    Thank you for taking the time in checking the legitimacy of this out. I'll definately give it a try.
     
    FuzzyLogic, May 28, 2006 IP
  9. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #9
    Has anyone done something fun apart from hiding more HTML elements with the collapsing units script?
     
    JamesColin, Jun 21, 2006 IP
  10. ruph

    ruph Well-Known Member

    Messages:
    137
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    131
    #10
    ruph, Jun 21, 2006 IP
  11. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #11
    What you have something against using the formatting tools? :)

    Plus I realise I gave my thread the wrong title, because it is not about making ads stand out after all, it's just the fact that you can do it without fear of having your graphics alone without adsense when there is no ad to display.
     
    JamesColin, Jun 21, 2006 IP