Welcome to Shaun Luttin's public notebook. It contains rough, practical notes. The guiding idea is that, despite what marketing tells us, there are no experts at anything. Sharing our half-baked ideas helps everyone. We're all just muddling thru. Find out more about our work at bigfont.ca.

Google Ad Words - Responsive Ad Units

Tags: google-ad-words

  1. Generate the ad code.
  2. Place the code on your site.
  3. Optionally, modify the ad code for advanced mode. None of the default codes worked for me. The following is what worked on this site. The most important parts are max-width:100%; overflow:hidden.
<style>
     .ad-sense-02-responsive { 
    width: 320px; 
    height: 50px; 
    max-width: 100%; 
    overflow:hidden; 
    display:block !important; 
    margin:auto !important; 
    margin-top:25px !important; 
     }
     /* the @@ is for Razore Views */
     @@media(min-width: 500px) { .ad-sense-02-responsive { width: 468px; height: 60px; } }
     @@media(min-width: 800px) { .ad-sense-02-responsive { width: 728px; height: 90px; } }
</style>

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

<!-- ADSENSE02_Responsive --> <ins class="adsbygoogle ad-sense-02-responsive" style="display:inline-block" data-ad-client="ca-pub-6542429488011130" data-ad-slot="9782767204"></ins>

<script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>

References

https://support.google.com/adsense/answer/3213689

https://support.google.com/adsense/answer/3543893

https://support.google.com/adsense/answer/179887

https://support.google.com/adsense/answer/157492?ctx=tltp