Your First Ad Unit
Create a slot in the dashboard, copy the two-line div snippet, drop it in your HTML — that's it. Sizes load from the API automatically, no hardcoding needed.
Once your website is approved, you can create ad units and start serving ads. An ad unit is a named slot in your page layout — you define it in the Advlume dashboard, then drop a small HTML <div> wherever you want an ad to appear. This guide walks you through the whole process from creation to placement.
What you need first
- Your site must be in Approved status. Ad unit creation and placement snippets are locked while a site is still Pending.
- You need access to edit your site's HTML (theme templates, page builder, or source code).
- The Advlume script tag must already be in your
<head>— see Adding Your First Website if you haven't done this yet.
Step 1 — Create the ad unit
Go to Sites → your domain → Create ad unit. You'll see a small form with three fields:
Slot key (required)
A short, lowercase identifier for this placement. It becomes part of the Google Ad Manager ad unit path, so pick something descriptive and permanent:
leaderboard-top
in-content
sidebar-right
below-fold
Rules: lowercase letters, numbers, hyphens and underscores only. No spaces. Max 64 characters. You can't change the slot key after creation without deleting and recreating the unit, so choose thoughtfully.
Label (optional)
A human-readable name displayed only inside the Advlume dashboard — your visitors never see it. Use it to keep things organised when you have many slots:
Above the fold leaderboard
In-article after paragraph 3
Sticky sidebar — desktop only
Sizes (required)
Pick every ad size this slot should accept bids for. The multi-select dropdown shows all standard IAB sizes. A few tips:
- Select more sizes, not fewer. More eligible sizes means more bidders can respond. A slot locked to a single size leaves money on the table.
- Mix leaderboard and banner.
728×90serves desktop,320×50serves mobile — select both and the wrapper automatically maps each to the right viewport. - Don't add sizes your layout can't accommodate. A 970×250 billboard selected for a 300px sidebar column will never render cleanly.
Click Create ad unit. The unit is saved to Advlume's database instantly, synced to Google Ad Manager in the background, and your site config is republished to the CDN — all within a few seconds without blocking your save.
Step 2 — Copy the placement snippet
After creation, the new unit appears in the Ad units & snippets section below the form. Each unit shows:
- The slot key and optional label
- Size badges for every size you selected
- The ready-to-paste placement snippet
The snippet looks like this:
<div
data-advlume-site=YOUR-SITE-UUID
data-advlume-slot=leaderboard-top
></div>
The UUID is pre-filled with your site's unique identifier. There's no need to hardcode sizes in the HTML — the wrapper fetches them from the API automatically on every page load, so you can update sizes in the dashboard without touching your templates.
Step 3 — Place the div in your HTML
Drop the snippet anywhere in your page body where you want an ad to appear. A few placement guidelines:
Where to put it
- Leaderboard: directly after the opening
<body>tag or at the top of your main content column, before the first paragraph. - In-content: between paragraphs, typically after the 2nd or 3rd paragraph for best viewability.
- Sidebar: inside a sidebar column, sized 300×250 or 300×600.
- Sticky footer: use
data-advlume-format=footeron the div — the wrapper mounts it as a position-fixed bottom bar with a close button automatically.
What to avoid
- Don't put more than one div with the same
data-advlume-sloton a single page — the slot key must be unique per page load. - Don't hide the div with
display:none— GAM won't serve into a hidden element. - Don't place it inside an
<iframe>or cross-origin embed.
Step 4 — Verify it's working
Open the page in a browser, open DevTools console, and look for Advlume log lines:
[advlume] Config loaded for site YOUR-UUID
[advlume] Active bidders: adformOpenRTB, adkernel, nexx360 …
[advlume] GAM targeting for advlume-leaderboard-top-0: {hb_bidder:[adformOpenRTB],hb_pb:[1.50] …}
[advlume] Ad rendered: advlume-leaderboard-top-0 path=/NETWORK/yourdomain.com/leaderboard-top via=lineItem
If you see Ad rendered, the slot is live. You can also check the Live dashboard — winning bids from your page will appear in the Recent bids feed in real time.
Editing sizes after creation
Click Edit sizes next to any existing ad unit to open the inline size editor. Select the new size set and click Save sizes. The change is saved instantly in the UI; GAM and the CDN config update in the background within a few seconds. No redeploy needed.
Deleting an ad unit
Click Remove next to the unit and confirm the prompt. The unit is archived in Google Ad Manager (so historical reporting is preserved) and removed from the CDN config. Remove the corresponding <div> from your HTML when convenient — the wrapper silently ignores orphan divs for unknown slot keys.
How many ad units should I create?
There's no hard limit, but quality beats quantity:
- 3–5 well-placed, in-viewport slots typically outperform 10+ slots scattered below the fold.
- Buyers bid more aggressively on placements that are viewable. Slots users rarely scroll to will have low fill and poor CPMs.
- Standard starting setup: one leaderboard above the fold, one in-content unit mid-article, and a sidebar unit on desktop.
Next steps
- Going Live Checklist — verify everything is wired up correctly before opening to full traffic
- Best Practices for Ad Placement — viewability, layout shift, and density recommendations
- Supported Banner Sizes — full table of available sizes and which work best in which context
- Adding Ad Unit Divs — deeper look at every HTML attribute the wrapper understands
Last updated 2 months ago