title: How to programmatically collapse space in empty div when google ad does not show
body: <p>Is there any way to programmatically collapse the empty space that results when a google ad does not show? If so, I would love to see an illustrative example of the same.</p>
  
  <p>Searching around has led me to <a href="https://support.google.com/dfp_premium/answer/3072674?hl=en" rel="noreferrer">this official Google resource</a> for accomplishing exactly what I've asked. However, that pertains to Doubleclick for Publishers, which is unfortunately a separate product. I'm pining to know how to handle this for AdSense - some of my users are staring at empty spaces at the moment.</p>
  
  <hr>
  
  <p>In case it matters, here's an example ad snippet provided by Google AdSense (which I've center-aligned):</p>
  
  <pre><code>    &lt;div style="text-align:center"&gt;
          &lt;ins class="adsbygoogle"
               style="display:block"
               data-ad-client="ca-pub-0000000000000000"
               data-ad-slot="0044031319"
               data-ad-format="auto"&gt;&lt;/ins&gt;
          &lt;script&gt;
          (adsbygoogle = window.adsbygoogle || []).push({});
          &lt;/script&gt;
      &lt;/div&gt;
  </code></pre>