Adding Ad Unit Divs

Add banner, footer, outstream, and instream slots using simple data- attributes. No JavaScript required — the wrapper discovers the divs and runs auctions automatically.

After the Advlume script is installed, you add ad slots to your pages by placing empty <div> elements with specific data- attributes. The wrapper discovers these divs automatically, runs auctions for each, and renders the winning creatives inside them.

Basic banner slot

<div
  data-advlume-site="YOUR-SITE-UUID"
  data-advlume-slot="leaderboard"
></div>

The data-advlume-site attribute is your site UUID (the same one in the script tag). The data-advlume-slot is the slot key you defined in the dashboard when creating this ad unit.

You do not need a data-sizes attribute — the wrapper loads your configured sizes from the CDN automatically.

Attributes reference

AttributeRequiredDescription
data-advlume-siteYesYour site UUID from the dashboard
data-advlume-slotYesSlot key matching the ad unit name in the dashboard
data-advlume-formatNoAd format: banner (default), footer, outstream, instream
data-sizesNoFallback sizes as a JSON array (e.g. [[728,90],[300,250]]). Overridden by API config.

Sticky footer slot

<div
  data-advlume-site="YOUR-SITE-UUID"
  data-advlume-slot="footer"
  data-advlume-format="footer"
></div>

Place this anywhere in the page body. The wrapper will move it to a fixed bottom bar — you do not need to style the containing element.

Outstream video slot

<div
  data-advlume-site="YOUR-SITE-UUID"
  data-advlume-slot="video-mid"
  data-advlume-format="outstream"
></div>

Preventing layout shift

Banner slots have no height until the creative loads. Reserve the space with a min-height CSS property to prevent your content jumping:

<div
  data-advlume-site="YOUR-SITE-UUID"
  data-advlume-slot="leaderboard"
  style="min-height:90px"
></div>

Multiple slots on a page

You can place as many slots as you have ad units configured in the dashboard. Each slot is discovered and auctioned independently. The wrapper assigns a unique internal ID to each slot (e.g. advlume-leaderboard-0) — do not set a manual id attribute on the slot divs, as it will be overwritten.

Getting your snippets

Ready-to-paste snippets for all your ad units are available in the dashboard under Website → [site name] → Ad Units & Snippets. Each snippet is pre-filled with your site UUID and slot key.

Further reading

Last updated 2 months ago