Step 3: Ad Placements
Now that you've integrated Ezoic's scripts and set up your ads.txt file, the last step is to tell Ezoic where ads should appear on your pages. Each spot where an ad can show is called a placement. In the Ezoic Dashboard, placements are listed as Placeholders.
Choose Your Setup
There are two ways to add placements:
- Placement IDs (recommended): each ad spot on your site uses a placement from your Ezoic Dashboard. You and your Ezoic account team can change each spot's sizes and settings from the dashboard at any time, without touching your site's code again.
- Quick start: paste the same snippet wherever you want an ad, and Ezoic sets up each spot automatically. It's the fastest way to get ads running, but you have less control over each spot afterwards.
| Placement IDs (recommended) | Quick start | |
|---|---|---|
| What you add to your site | A placeholder div per ad spot, plus one script |
One snippet per ad spot |
| Change sizes from the Ezoic Dashboard | Yes, per placement and device | No |
| Reporting per ad spot | Yes | Approximate |
| Direct deals, mediation, targeting a specific spot | Supported | Not supported |
Not sure which to pick? Use placement IDs. Choose the quick start only for a simple site that doesn't need per-spot sizing, reporting, direct deals or mediation. Switching from the quick start to placement IDs later means changing your site's code again.
location on every showAds call.
Placement IDs
1. Find your placement IDs
Open the Placeholders page in your Ezoic Dashboard. Ezoic creates some placements for your site by default, so you may already have the ones you need. Use those, or create new ones for any other spots. Your Ezoic Onboarding Specialist can also recommend placements for your layout.
Note the ID of each placement you want to use, for example 101 for the top of your articles and 102 for the sidebar.
2. Add a placeholder for each spot
Where you want each ad to appear, add an empty div with that placement's ID:
<div id="ezoic-pub-ad-placeholder-101"></div>
Do not add styling to the placeholder div. Adding styles or reserving space for it may leave empty white space if an ad does not load.
3. Show the ads
After the placeholders on the page, add one script that lists every placement ID used on that page:
<div id="ezoic-pub-ad-placeholder-101"></div>
<!-- ... page content ... -->
<div id="ezoic-pub-ad-placeholder-102"></div>
<script>
ezstandalone.cmd.push(function () {
ezstandalone.showAds(101, 102);
});
</script>
Use one showAds call with all the IDs rather than one per placement. This reduces server requests and helps ads load faster.
That's it. From now on, each placement's sizes and settings are managed from the Ezoic Dashboard, per device, without editing your site.
Quick Start
Paste this snippet wherever you want an ad to appear, and set location to where that spot is on the page:
<script>
ezstandalone.cmd.push(function () {
ezstandalone.showAds({ location: "under_page_title" });
});
</script>
Use one snippet per ad spot, each with its own location. For example, an article page might use under_page_title below the headline, mid_content halfway through the article, bottom_of_page after the article, and sidebar in the sidebar.
Supported locations are top_of_page, under_page_title, under_first_paragraph, under_second_paragraph, mid_content, long_content, longer_content, longest_content, bottom_of_page, sidebar, sidebar_middle, and sidebar_bottom.
You can leave location out (ezstandalone.showAds({})) and Ezoic will work it out from your page layout, but on some layouts it can pick the wrong location, for example treating a sidebar as the top of the page. Setting location avoids that.
Tips For Both Setups
- You don't need to request specific ad sizes. Ezoic picks the size based on your site's configuration, the visitor's device, and available demand.
- Ads never stack: use one snippet or placeholder per spot. To show several ads, place them at different positions on your page.
- Remove any leftover ad code from other ad networks, or Ezoic ads may not work properly.
Check Your Setup
Open any page with ads and add ?ez_js_debugger=1 to the URL, for example https://www.yourwebsite.com/?ez_js_debugger=1. The JavaScript Integration Debugger shows each ad spot, its ID and location, and whether an ad loaded. See Troubleshooting for how to read it.
Need More Control?
To request specific sizes, set different sizes per device, or place ads from JavaScript (single-page apps, infinite scroll), see ShowAds advanced usage, or generate a snippet with the ShowAds Builder.
Setup Complete
Once your placements are showing ads, EzoicAds is set up on your site. If you have any questions or need help, reach out to your Ezoic Onboarding Specialist or Ezoic's support team.