If you can edit the HTML, you can install the widget. This guide covers a plain static site: hand-written pages, a static host, or a generator that lets you edit a shared footer. It was not tested on a live deployment.
Where the two lines go
Paste them immediately before the closing </body> tag, after all your content and your own scripts:
<div data-popuploom="YOUR_WIDGET_ID"></div>
<script src="https://popuploom.com/embed/1.2.0/popuploom.js"></script>
Order matters a little: the div must exist before the script runs. Placing both at the end of the body guarantees that, and keeps the popup from delaying the content above it.
Every page, or a shared footer
| Setup | What to do | Risk |
|---|---|---|
| Hand-written pages | Add the two lines to each file that should show the popup. | Easy to miss a page or paste twice. |
| Shared footer partial | Add them once to the include used by every page. | A page that uses a different layout will not get it. |
| Static site generator | Put them in the base layout or footer component. | Generator-specific templating; check the built HTML. |
One copy per page is the rule. Two copies load the widget twice, and the second can initialise the same widget again.
Do not test from the file system. Opening the page with file:// blocks the configuration request in most browsers. Serve the folder over http, for example with python -m http.server, and test at http://localhost:8000. A popup that “does not work” locally is often just the protocol.
Caching and updates
The script URL is versioned and immutable: /embed/1.2.0/popuploom.js. Browsers and CDNs can cache it for a long time, which is why the version is in the path. Your popup's content and targeting are fetched as configuration at runtime, so editing the popup in the studio does not require touching the HTML.
If you change the snippet itself, update the HTML and redeploy. If the site sits behind a cache, purge the page, not the script.
CSP
If the site sends a Content Security Policy, allow https://popuploom.com in script-src and connect-src. A blocked script shows as a console error; a blocked config request shows as an invisible popup.
Test checklist
- Serve over http, open the page in a private window.
- Confirm the popup appears once, not twice.
- Submit a test response and check the lead inbox.
- Reload: the frequency rule behaves as configured.
- Check the page on a phone width and with caching enabled on the host.
Removal
Delete the two lines and redeploy. The saved popup remains in the studio.
Common questions
Do I need to add the snippet to every page?
If every page has its own HTML file, yes, or add it to the shared footer include your build uses. One copy per page is enough. Two copies load the widget twice.
Why does the popup not appear when I open the file directly?
Opening an HTML file from disk uses the file:// protocol, which blocks the configuration request and can behave differently for scripts. Serve the folder over http with any local server and test again.
Can I self-host the script file?
You can host a copy of the versioned file, but the widget still needs to fetch its configuration from PopupLoom. Self-hosting changes where the code is served from, not how the saved popup is loaded, and it means you own updates.
How do I update a popup after installing the snippet?
Edit and save it in the studio. The page loads the saved configuration at runtime, so you do not need to change the HTML again. Only a change to the snippet itself requires editing the page.
Official references
- MDN: script element — placement, async and defer.
- MDN: Content Security Policy — script-src and connect-src.
Written by Shailu016, founder of PopupLoom. Checked on 17 November 2026; not tested on a live deployment. No ranking, traffic or conversion claim is made. Related: the general install guide, Tag Manager, Astro, Next.js and popup not showing.