Installing the Advlume Script
One script tag is all you need. Place the personalised hb.js tag in your <head> — it loads Prebid, GPT, CMP, and the video module automatically.
The Advlume wrapper is a single JavaScript file — hb.js — that loads everything else: Prebid.js, Google Publisher Tags, the CMP, and the video module if needed. Publishers only need to add one script tag to their site.
Getting your script tag
Your personalised script tag is found in the Advlume dashboard under Website → [site name] → Installation. It includes your site UUID as a query parameter:
<script src="https://cdn.advlume.com/hb.js?site=YOUR-SITE-UUID" async></script>
The async attribute is important — it prevents the script from blocking page rendering.
Where to place the script tag
Place the script tag in the <head> section of your HTML, as early as possible — ideally before any other third-party scripts:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Your Page Title</title>
<!-- Advlume — place before other ad or analytics scripts -->
<script src="https://cdn.advlume.com/hb.js?site=YOUR-SITE-UUID" async></script>
</head>
<body>
...
</body>
</html>
Placing it in <head> gives the script the maximum time to fetch your site config and run the Prebid auction before the page finishes rendering. If you place it at the bottom of <body>, ads will load after all other content, which can cause visible layout shifts.
What the script loads
After the script tag executes, hb.js automatically loads in parallel:
- Prebid.js — for the header bidding auction
- Google Publisher Tags (GPT) — the Google Ad Manager ad rendering library
- InMobi Choice CMP — for consent management (GDPR/TCF, GPP, CCPA)
- hb-video.js — loaded on demand only if a video or outstream slot is found on the page
- Traffic quality monitoring script — loaded if configured for your site
You do not need to add separate script tags for any of these. The single hb.js tag handles the entire setup.
Verifying the installation
After adding the script tag:
- Open your site in a browser and open DevTools (F12).
- Check the Console tab for lines starting with
[advlume]. You should see:[advlume] Config loaded for site YOUR-UUID [advlume] Active bidders: ... - Check the Network tab for requests to
cdn.advlume.com,securepubads.g.doubleclick.net, andprebid.adnxs.com. - Return to the Advlume dashboard. Traffic signals should appear within a few minutes of the first page load.
Content Security Policy (CSP)
If your site uses a Content Security Policy, you will need to add the following domains to your script-src and connect-src directives:
cdn.advlume.com— wrapper and Prebid scriptssecurepubads.g.doubleclick.net— Google Publisher Tagsadvlume.com:6001— real-time WebSocket connection*.doubleclick.net,*.googlesyndication.com— GAM ad delivery
For a full CSP whitelist including all demand partners, contact your account manager.
Further reading
- Adding Ad Unit Divs — adding banner slots after the script is installed
- Going Live Checklist — everything to verify before launch
- Console Errors & Debugging — reading the wrapper's log output
Last updated 2 months ago