The ads you include on your website is doing “document.write”
They block your webpage from being rendered nicely – chunks appear as ads comes in
Drop ads, or change ads provider.
Refactor your web page, so that ads are at the bottom & all your content renders before them
Use postload_google_ads plugin to do (3) for you.
In this implementation, jQuery, Hpricot & Rails are required.
Make sure you give your <script> tags for google something identifiable, e.g. <script class=“googleads”> Then configure the necessary controller:
class ApplicationController < ActionController::Base include PostloadGoogleAds # step 1 @@google_ads_cssselector = 'script.googleads' # step 2 cattr_accessor :google_ads_cssselector # step 3 after_filter :postload_google_ads # step 4 end
Restart your Rails server and see
To prevent ads from shifting your layout, it is best to wrap your google ads <script> tag in something (e.g. div) and give it an explicit height width.
Copyright © 2009 Chew Choon Keat, released under the MIT license