REGISTER  


Google AdSense causes flickers and slow page loads
This thread belongs to monie.forumgeeks.net


2009-03-15 14:45 GMT   |   #1

Comments: 13

I try to create a small site for myself, but my problem is that if I insert Google AdSense the page flickers, and also the page load slows down.

I googled around a lot but I could not find any answer how could I avoid this.

Anyone had success with this?

2009-03-17 16:09 GMT   |   #2

Comments: 42

This seems to be everyone's problem, especially the slow page load time.It's strange that Google does not react.

Either way, you can do the same thing this site does:

  • Create a div where you would like to put the ads. Let's give it the id adsense_container. For example:
    <div id=adsense_container style="display:inline;"></div>
  • On the bottom of the page create an initially hidden div which contains nothing but your adsense script. For example give the id "adsense_div" to your div:
    <div id=adsense_div style=display:none>
      <script type="text/javascript"><!--
        google_ad_client = "pub-xxxxxxxxxxxxxxxx";
        google_ad_slot = "xxxxxxxxxx";
        google_ad_width = xxx;
        google_ad_height = xxx;
      //-->
      </script>
      <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
    </div>
  • Finally at the end of the page reparent the adsense_div to be inside the adsense_container:
    <script language=javascript>
        document.getElementById("adsense_container").appendChild(document.getElementById("adsense_div"));
        document.getElementById("adsense_div").style.display="inline";
    </script>

Hope this helps everyone.