I want to insert an ad:slot into a view.
How does this work?

I have tried to insert it like underneath here using the original javascript from the admanager website, but it only shows a blank area.

<?php print $list_type_prefix; ?>
    <?php foreach ($rows as $id => $row): ?>
      <li class="<?php print $classes_array[$id]; ?>"><?php print $row; ?></li>
      
      <?php if (($id) == 5): ?>

 
<div id='div-gpt-ad-PUBLISHERID' style='width:300px; height:250px;'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-PUBLISHERID-0'); });
</script>
</div>
  <?php endif; ?>
    <?php endforeach; ?>
  <?php print $list_type_suffix; ?>
<?php print $wrapper_suffix; ?>