Ad spots are marked with plain div elements carrying
the ezoicad class and per-ad config in data-* attributes
(data-sizes, data-fluid, data-devices, …), then a
single call — showAds(".ezoicad") — places one ad inside each matched element. The
publisher styles the container; the ad placeholder is appended inside it. Elements are used only
once: the button at the bottom appends a new spot and repeats the same call, and only the new
element gets an ad — the SPA / infinite-scroll pattern.
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>
<!-- Body: mark ad spots wherever you want them -->
<div class="ezoicad" data-sizes="300x250,336x280" data-mobile_sizes="300x250"></div>
<div class="ezoicad" data-sizes="300x250" data-fluid="false"></div>
<div class="ezoicad" data-devices="desktop" data-sizes="728x90"></div>
<!-- One call places them all -->
<script>
ezstandalone.cmd.push(function () {
ezstandalone.showAds(".ezoicad");
});
</script>
This page marks its ad spots with plain divs carrying the ezoicad class and
per-ad config in data attributes, then makes a single showAds(".ezoicad") call.
No placeholder ids and no per-spot scripts.
The spot above passes a desktop size list plus a mobile override via
data-mobile_sizes. The next spot opts out of fluid (native-style) creatives with
data-fluid="false", so its GPT slot size list must not contain
fluid.
Some more paragraph content between the spots so the page reads like a real article and the
location classifier has words to work with. The dashed green outlines mark the publisher-owned
container divs; the outlined red placeholder is appended inside them.
The spot directly above is desktop-only via data-devices="desktop" — on a phone
it stays empty and no request is made for it. Below, a button appends a brand new
ezoicad div and repeats the same call. The already-consumed spots above must be
skipped (no double ads); only the new element gets an ad.