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.

Google Adsense for Search: Big gap after search results

Discussion in 'Placement / Reviews / Examples' started by Azam.biz, Sep 2, 2006.

  1. #1
    I've implemented Adsense for Search on our site, but there is a gap of several lines after the results appear. Is there any way of getting rid of this? I've tried everything.

    The code given to add to our customised search results page is:

    Code (Text):
    1.  
    2. <!-- Google Search Result Snippet Begins -->
    3. <div id="googleSearchUnitIframe"></div>
    4. <script type="text/javascript">
    5.    var googleSearchIframeName = 'googleSearchUnitIframe';
    6.    var googleSearchFrameWidth = 728;
    7.    var googleSearchFrameHeight = 0;
    8.    var googleSearchFrameborder = 0 ;
    9.    var googleSearchDomain = 'www.google.co.uk';
    10. </script>
    11. <script type="text/javascript"
    12.          src="[URL]http://www.google.com/afsonline/show_afs_search.js[/URL]">
    13. </script>
    14. <!-- Google Search Result Snippet Ends -->
    15.  
    The Google search box is on the bottom of this page: http://www.UKHotMovies.com/interactive

    Cheers :)

    Just discovered that the webpages shown in the search results are not clickable :(

    Any ideas?
     
    Azam.biz, Sep 2, 2006 IP
  2. hans

    hans Well-Known Member

    Messages:
    2,924
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #2

    the code you puplish HERE is NOT AT ALL the code you actually HAVE on your site.!!!

    have an exact look at it and you see that you messed around with your code very solidly

    a normal full G adsense search code has some 40 lines
    you have 80+ lines

    it looks like you coppied your code twice - inside each other - but in a messy way, hence only one search box appears. as a result now you have an invald G saearch code.

    remove all G adsense search code again form your site, then
    go to your G adsense account and get the original Search code again
    paste first into a text file to see how it looks if correct, ...

    then past again into your web site and you have NO gap at all.
    the current gap ONLY is created by the 2nd G adsense code you have where only ONE set of code belongs.

    and after all that
    you may even want to have a look at all the many OTHERT HTML code errors you maintain and carry on so far on that page already
    see
    http://validator.w3.org/check?verbose=1&uri=http://www.ukhotmovies.com/interactive/

    a code clean up always helps in many ways sooner or later
     
    hans, Sep 2, 2006 IP
  3. Azam.biz

    Azam.biz Active Member

    Messages:
    439
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    80
    #3
    I don't know what you are talking about. It is the exact code, which you can verify by studying the HTML on this page.

    As you know, there is one code to add for the search box and another for the search results page. I haven't changed them at all in the manner you are talking about.

    I haven't changed anything apart from trying to change the FrameHeight to different amounts, but that has made no difference.

    Can anybody help properly please?
     
    Azam.biz, Sep 2, 2006 IP
  4. amitpagarwal

    amitpagarwal Peon

    Messages:
    375
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You see the white space because Google site search hard codes the iframe height to 1650.

    You can check this for yourself by viewing the source of the search results page.

    I don't think there will be any way to override this as this is generated by Google after you click the search button.
     
    amitpagarwal, Sep 2, 2006 IP
  5. Azam.biz

    Azam.biz Active Member

    Messages:
    439
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    80
    #5
    Thanks very much for that.

    Can't believe Google can be so stupid to hardcode a height of 1650.

    Can anybody think of a workaround at all? Otherwise will have to implement another script to do site search.
     
    Azam.biz, Sep 2, 2006 IP
  6. amitpagarwal

    amitpagarwal Peon

    Messages:
    375
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #6
    My suggestion would be to stay away from any workaround as that might go against the Adsense TOS.
     
    amitpagarwal, Sep 2, 2006 IP
  7. hans

    hans Well-Known Member

    Messages:
    2,924
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #7
    yes you are right
    i have NOT checked the search code for onsite results yet.
    nevertheless you have a foreign code snipplet in your search code

    <font color="black" face="verdana, arial" size="2"><br><br>

    and still far too many html errors on that page - some of the errors may cause soem bots to choke!

    re result page
    be careful to change size - because on a HIGH resolution screen the results are too small for comfortable reading - if i SWITCH the font size (Ctrl + +) one step larger - then the Lycos search box on the result page is already partially covered.

    the gap ONLY exists if Google has INsufficient number of advertisers above AND/olr below the search results

    in search results with all Google ad slots filled the results are just ending above the lycos search box.

    try different keywords then you see - hence Google just has reserved the space it actually uses up if all ads are avaiable.
     
    hans, Sep 2, 2006 IP
  8. gredo

    gredo Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I had the same problem with the huge gap at the bottom of my search results. But I found a tweak!
    Instead of picking up your code for the search from AdSense, make a Google CSE (Custom Search Engine, http://www.google.com/cse). You can connect your AdSense account with your the CSE account and still get paid for the clicks. But in addition to allowing you to configure the search in far more detail than with AdSense, the CSE search results page does not have the ugly bug of leaving the huge vertical gap below the results.

    See how nice mine works now:
    http://gredic.com/search.html
     
    gredo, Feb 3, 2008 IP
  9. slinky

    slinky Banned

    Messages:
    717
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Idiotic. Confirmed that I get the same big gap although it's periodical. Sometimes it's 1650, other times it's just damn large.
     
    slinky, Mar 29, 2008 IP
  10. Rasczak

    Rasczak Peon

    Messages:
    131
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Hey guys, I solved this problem by adding this line to the JS code:

    var googleSearchPath = "/cse";

    The gap is gone. Now I wonder how can I customize fonts, colors, etc... Does anybody know?
     
    Rasczak, Apr 9, 2008 IP
  11. Yankee85

    Yankee85 Peon

    Messages:
    1,072
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #11
    What "/cse" means?
     
    Yankee85, Apr 19, 2008 IP
  12. webpage-creation

    webpage-creation Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #12
    These solutions, along with putting

    var googleSearchResizeIframe = true;

    work in FF and IE but not Safari, any ideas on Safari?

    =D

    Mark
     
    webpage-creation, Apr 21, 2008 IP
  13. Yankee85

    Yankee85 Peon

    Messages:
    1,072
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #13
    An idea for Safari is to use IE/FF :D
     
    Yankee85, Apr 22, 2008 IP
  14. webpage-creation

    webpage-creation Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #14
    :p

    Any other potential fixes for Safari?
     
    webpage-creation, Apr 30, 2008 IP
  15. Yankee85

    Yankee85 Peon

    Messages:
    1,072
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #15
    No, sorry. I only use IE and very few times, FF.
     
    Yankee85, May 2, 2008 IP
  16. angilina

    angilina Notable Member

    Messages:
    7,825
    Likes Received:
    186
    Best Answers:
    0
    Trophy Points:
    260
    #16
    "gredo"

    You have replied to a 2 years old thread ? :)
     
    angilina, May 2, 2008 IP
  17. Yankee85

    Yankee85 Peon

    Messages:
    1,072
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #17
    It's better than opening new ones for the same topic :)
     
    Yankee85, May 3, 2008 IP
  18. nicheestates

    nicheestates Peon

    Messages:
    676
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Has google changed the hard coding on this or is it still the same?
     
    nicheestates, Jun 25, 2008 IP
  19. goggle

    goggle Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    I tried the var googleSearchResizeIframe = true; code with varying results.

    Still get the white space in IE6, mozilla, Opera 9.
    Works fine in IE7 and FF.
     
    goggle, Aug 15, 2008 IP