title: Collapsing Google Adsense Divs
body: <p>I have read a number of discussions on this, however most are related to using Google Publisher Tags and not responsive ads.</p>
  
  <p>I have set responsive ads from within Adsense to "Collapse this adunit, otherwise show a blank space"</p>
  
  <p>The problem is that my first ad unit on the page always shows a blank 280x300 blank space on mobile devices.</p>
  
  <p>All of the other adspaces collapse as expected. I tried to remove the top advertisement (above the fold). When I do this, the 2nd ad unit (which is now the 1st) is showing a large 280x300 blank space.</p>
  
  <p>It will initially be collapsed on load, then quickly expands to show a blank space.</p>
  
  <p>I have tested this on both samsung browser and chrome mobile browser. This is creating a problem as I now have a large blank space above the fold. I have also set my adsense display balance to 60% so a blank adspace happens frequently.</p>
  
  <p>I am using the following code (fairly standard adsense code)</p>
  
  <pre><code>&lt;div class="bottommargin-sm"&gt;
      &lt;ins class="adsbygoogle"
          style="display:block;"
          data-ad-client="ca-pub-xxxx"
          data-ad-slot="xxxx"
          data-ad-format="auto"&gt;&lt;/ins&gt;
          &lt;script&gt;
              (adsbygoogle = window.adsbygoogle || []).push({});
          &lt;/script&gt;       
  &lt;/div&gt;'
  </code></pre>
  
  <p>The only solution I have seen is this <a href="https://support.google.com/admanager/answer/3072674?hl=en" rel="nofollow noreferrer">https://support.google.com/admanager/answer/3072674?hl=en</a> however this is not for responsive ads that I have setup</p>
  
  <p>Other things I have tried include: loading a dummy ad unit first with display set to none, disabling async, changing parent div to row/container-fluid. Disabling Addthis/OneSignal plugins, disabling cloudflare rocketloader, adding 100%/auto width/height, adding overflow:hidden to parent div. Surround the window.adsbygoogle code with window.onload = function(){.</p>
  
  <p>Another option I thought I could try would be to migrate to DoubleClick and I assume they would have away to manage this situation?</p>