To place a bar inside your page instead of across the top, set its position to inline and give it the id of an element on your page, for example promo-bar. Then add <div id="promo-bar"></div> where the bar should appear: above the product price, under a hero image, inside a pricing table. The bar renders inside that element. Pages that do not have the element do not show the bar at all, which makes the element itself a simple way to choose pages.
This guide covers the setup, the rules for the id, what happens on pages built with JavaScript, and when inline is the better choice.
The four positions
A bar can sit in one of four places:
| Position | What it does | Good for |
|---|---|---|
| Sticky top | Fixed to the top of the window while scrolling | Site-wide sales |
| Top of page, in flow | First thing on the page, scrolls away | Announcements that should not follow the reader |
| Fixed bottom | Fixed to the bottom of the window | Mobile-heavy stores where the top is crowded |
| Inline, inside your page | Inside an element you choose | A deadline or count next to the thing it is about |
The first three compete with your header, cookie banner and any chat widget. Inline sits in your layout like any other block, so it does not cover anything.
Setting it up
- Open the bar and set Position to Inline, inside your page.
- In Show inside the element with id, type an id such as
promo-bar. A leading#is removed for you. - Add an empty element with that id to your page, where the bar should appear:
<div id="promo-bar"></div>
- Keep the site snippet (or the bar's own snippet) on the page as usual. The bar finds the element and renders inside it.
Where to add the element depends on your platform:
| Platform | Where to put the element |
|---|---|
| Plain HTML | In the page template, where the bar should sit |
| WordPress | A Custom HTML block in the editor, or your theme template |
| Webflow, Framer, other builders | An embed or custom code element |
| React, Next.js, Vue | A <div id="promo-bar" /> in the component |
If you leave the id empty, an inline bar renders where its snippet is pasted. That works when you paste the bar's own snippet into the page body. With one site-wide snippet in the footer, use an id so the bar lands where you want it.
Rules for the id:
- It must start with a letter, and can contain letters, numbers, hyphens, underscores, colons and dots.
promo-bar,bf_countdownandpricing.deadlineare fine. - It should be unique on the page. If two elements share the id, the bar uses the first one.
- Use an empty element. The bar is added inside it, so anything already there stays above the bar.
When the element is missing
Some sites add their content after the page loads: single-page apps, page builders and themes that render sections with scripts. If the element is not there yet when the bar loads, the bar waits for it for up to 5 seconds and renders as soon as it appears.
If the element still does not exist after that, the bar stays hidden on that page and a short warning is written to the browser console naming the missing id. It never falls back to the top of the page. A bar that shows in a place you did not design for is worse than no bar.
The element doubles as page targeting. Because a missing element means no bar, the element doubles as targeting. Put <div id="bf-deadline"></div> only in your Black Friday collection template and the bar appears only there.
You can still combine it with the bar's page targeting (all pages, only these, or all except, with wildcards) and device targeting. Both have to allow the page, and the element has to exist.