What this demonstrates

Placements that come and go within a single pageview. When new placeholder divs are added to the page, ezstandalone.showAds(ids) activates them. When that content is removed, ezstandalone.destroyPlaceholders(ids) must run before the divs leave the DOM so the slots are torn down cleanly. When the same content becomes visible again, showAds(ids) re-activates it. The buttons below add a comments section carrying placements 151 and 152, tear it down, and re-add it; the status bar logs each call.
Integration used on this page
<!-- Head: consent + Ezoic standalone loader -->
<script data-cfasync="false" src="https://cmp.gatekeeperconsent.com/min.js"></script>
<script data-cfasync="false" src="https://the.gatekeeperconsent.com/cmp.min.js"></script>
<script async src="//www.ezojs.com/ezoic/sa.min.js"></script>
<script>
  window.ezstandalone = window.ezstandalone || {};
  ezstandalone.cmd = ezstandalone.cmd || [];
</script>

<!-- After appending the divs: show the new placements -->
<script>
  ezstandalone.cmd.push(function () {
    ezstandalone.showAds(151, 152);
  });
</script>

<!-- Destroy them BEFORE removing their divs from the DOM -->
<script>
  ezstandalone.cmd.push(function () {
    ezstandalone.destroyPlaceholders(151, 152);
  });
</script>

<!-- Re-show after re-appending the divs -->
<script>
  ezstandalone.cmd.push(function () {
    ezstandalone.showAds(151, 152);
  });
</script>

View source on GitHub →

Docs: Dynamic Content — New Content · Changing Content

Dynamic content: show, destroy, re-show

This article starts with no comments. The two placements below live inside a comments section that only exists after you load it — a common pattern for lazy-loaded comment widgets, tabs, and expandable panels.

Use the buttons to add the comments section (which activates placements 151 and 152), hide it (which destroys them before their divs are removed), and load it again (which re-activates the same ids). Every call is logged in the status bar at the bottom of the page.