What this demonstrates

The docs-recommended way to run ads in an infinite feed with placement ids: each appended batch carries the next unused id from a pool of in-content placements and activates it with ezstandalone.showAds(id). Ids are never reused — the docs warn that duplicate ids on a page cause unpredictable behavior, and reusing an id requires destroying the original placeholder first. When the pool runs out, this page stops adding ad divs rather than reusing ids. This is the id-based counterpart to the id-less recycling variant at /idless/infinite, which destroys the oldest placeholder and reuses its generated id instead. Add ?burst=N to the URL to append N batches automatically. window.__placeholdersInfinite 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>

<!-- Initial in-content placement -->
<div id="ezoic-pub-ad-placeholder-153"></div>
<script>
  ezstandalone.cmd.push(function () {
    ezstandalone.showAds(153);
  });
</script>

<!-- Each appended batch adds the next unused placement id and activates it -->
<div id="ezoic-pub-ad-placeholder-154"></div>
<script>
  ezstandalone.cmd.push(function () {
    ezstandalone.showAds(154);
  });
</script>

View source on GitHub →

Docs: Dynamic Content — Infinite Scroll

Infinite scroll with unique ids

This feed uses a fixed pool of in-content placements created in the Ezoic dashboard. The initial article carries placement 153. As you scroll toward the bottom, each new batch of content is followed by the next unused id from the pool [154, 155, 156, 157, 158, 159, 160], activated with its own showAds(id) call.

No id is ever reused: the docs warn that duplicate ids on a page cause unpredictable behavior, and reusing an id requires destroying the original placeholder first. When the pool is exhausted this page stops adding ad divs and says so in the status bar. Add ?burst=7 to the URL to append batches automatically.