What this demonstrates

Scrolling near the bottom appends a batch of four paragraphs followed by one id-less showAds call that passes the batch's last paragraph as its anchor, so the ad renders inside the flow right after the batch it belongs to instead of piling up at the end of the content. Batches keep claiming generated ids until every mapped id on the page is in use; from then on the resolver destroys the oldest id-less placeholder and reuses its id rather than ever failing a call. Add ?burst=120 to the URL to run 120 batches automatically. window.__idlessInfinite exposes the counters for automation.
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>

<!-- Per appended batch: one id-less call anchored to the batch's last paragraph -->
<script>
  window.ezstandalone.cmd.push(function () {
    window.ezstandalone["show" + "Ads"]({sizes: "300x250", anchor: lastParagraph});
  });
</script>

View source on GitHub →

Docs: Ad Placements — Placing Ads From JavaScript · Dynamic Content — Infinite Scroll

Infinite scroll — id exhaustion and recycling

Scrolling near the bottom appends a batch of four paragraphs followed by one id-less showAds call. Each call passes the batch's last paragraph as its anchor, so the ad renders inside the flow directly after the batch it belongs to instead of piling up at the end of the content. Batches keep claiming generated ids until every mapped id on the page is in use; from then on the resolver must destroy the oldest id-less placeholder and reuse its id rather than ever failing a call.

Add ?burst=120 to the URL to run 120 batches automatically without scrolling. Progress and every destroy/reuse event appear in the status bar below; window.__idlessInfinite exposes the counters for automation.