Ezoic Ad Placements
How TriposRai.com implements Step 3 of the EzoicAds onboarding guide.
Overview
With Step 1 (site scripts) and Step 2 (ads.txt) complete, Step 3 is mapping your Ezoic placement IDs to real estate on the site. Placement IDs are created in the Ezoic dashboard under Monetization → Ad Tester → Placements. Once you create them there, copy the numeric IDs into the codebase.
Placement Configuration
Every placement lives in src/config.ts for easy updates:
export const EZOIC_PLACEMENTS = {
homepageTop: 0,
homepageMid: 0,
postHeader: 115,
postFooter: 0,
};
- Set an ID to
0ornullto disable that slot. postHeaderalready points to placement 115 (Ezoic’sincontent_5), which renders beneath each article title.- Replace the placeholder numbers with your actual IDs as soon as they’re available.
Component Usage
EzoicAdSlot.astro outputs Ezoic’s required markup and hands the ID to our helper that queues ezstandalone.showAds() automatically:
{EZOIC_PLACEMENTS.postHeader ? (
<EzoicAdSlot
slotId={EZOIC_PLACEMENTS.postHeader}
label="Article inline ad"
/>
) : null}
Because the component checks the ID, you can safely keep the tag in templates even when a slot is disabled in configuration.
Current Placement Map
- Article header (
postHeader) - Additional homepage slots (
homepageTop,homepageMid) are ready for use as soon as you assign real IDs.
Verification Checklist
- IDs in
EZOIC_PLACEMENTSmatch the values in the Ezoic dashboard. - Page source shows
<div id="ezoic-pub-ad-placeholder-XXX">elements for enabled slots. - Browser console has no Ezoic errors and ads begin filling once the domain is approved.
For guidance on refreshing or destroying placements during SPA navigation or infinite scroll, see Ezoic Dynamic Content.