In WordPress (what the client does)
BuilderOS → Home → Popups
- Popup list, with:
- the name and its
#popup-<id>link; - the Active / Inactive switch (an inactive popup isn’t shown even if it’s published) and its status (draft, scheduled, ended);
- when it opens (“On load · 5 s”, “Scroll · 50 %”, “Exit intent”…), where (“Whole site”, “On 2 pages · except 1 page”, “mobile only”…) and the frequency;
- the languages: “ES ✓” edits that translation and “+ EN” creates it (as a draft, with the content copied so you can translate it);
- Edit, Preview (opens the home page with the popup), Duplicate (as a draft and inactive, in all languages) and Delete (to the trash, in all languages).
- the name and its
- Create popup: pick a starting template, type the name and click “Create popup”. It’s created as a draft and the editor opens; it doesn’t appear on the site until you publish it.
- Newsletter: title, text and an email form with consent. It opens after 8 s or on exit intent; at most every 7 days and never after subscribing.
- Sale: pre-title, title, text, a button and “No, thanks”. It opens when scrolling down the page or on exit intent.
- Notice: a top bar with a message and a link, with no dark backdrop.
- Quick contact: side panel with the basic form. It opens with a button or link.
- The templates’ forms are configured in Home → Forms (recipients, subject, auto-reply): the Newsletter one appears as «Popup «name»» and Quick contact uses the «Basic form».
- Blank, and the package’s popup sections (the ones marked with
data-bos-role="popup").
In the editor
The popup is edited with the BuilderOS visual editor: package sections, items (title, text, button, image, form…), per-device styles and animations. The canvas shows the popup’s width. The sidebar (document tab) has five panels: Popup, Popup: when it opens, Popup: where it is shown, Popup: frequency and Popup: schedule:
- Popup: active, identifier (for the
#popup-<id>links), format (centered modal, top bar, bottom bar, left or right side panel, full screen), width, dark backdrop and its opacity, close on click outside, and the close button’s position (top right, left, or outside the popup). “Preview on the site” opens it over the home page with the latest saved changes. - When it opens (can be combined): on page load after N seconds, on scrolling to a %, exit intent (the mouse leaves through the top of the window, on desktop), on back navigation (optional, on mobile and tablet), after N seconds of inactivity, and on a click on a link or button.
- Where it’s shown: on the whole site or only on some pages, and “Except on” (page finder, with “Home page”); a page includes its translations. Devices (desktop, tablet, mobile) and visitors (everyone, logged-out only, logged-in only). The language is automatic.
- Frequency: always, once per session, or after it’s closed don’t show it again for N days; and “Don’t show again after submitting its form”.
- Schedule: from / to (site time).
Frequency applies to automatic opening. A click on a link or button always opens the popup (within its schedule), even if it has already been closed or submitted.
Open a popup from a button or link
Any link or button on the site opens a popup if it points to #popup-<id>, including a menu item or a button added in the editor:
<a href="#popup-newsletter">Suscríbete</a>
<button type="button" data-bos-popup-open="newsletter">Suscríbete</button>href="#popup-close"ordata-bos-popup-closecloses the open popup (useful for a “No, thanks”).- A URL with
#popup-<id>(for example/contacto/#popup-newsletter) opens the popup when the page loads. - From JavaScript:
BuilderOS.popups.open('newsletter'),BuilderOS.popups.close()andBuilderOS.popups.isOpen('newsletter'). Events (they bubble up from the popup):bos:popup-openandbos:popup-close, withevent.detail.id, andbos:popup-convert, withdetail: { id, kind: 'cta'|'form' }(a click on a link or button in the popup, except closing, and submitting a form, or a submitted form; once per opening). There are no new PHP hooks:bos:form-sentis reused as the input.
Analytics and segmentation
Analytics. Per popup and day, views (openings), closes, clicks and submitted forms are counted. Conversion = (forms + clicks) / views.
- Storage: option
builder_os_popup_stats(no autoload),día (UTC) => id => [vistas, cierres, clics, envíos]. Aggregates only, with no IP, no identifier and no cookie. Kept for 90 days (purged on save).uninstall.phpdeletes it, along with thebos_pop_rltransient. - Sending:
builder-os-popups.jsadds up the counts in memory and sends a singlesendBeaconper page view (onpagehideor when the tab is hidden) toPOST /wp-json/builder-os/v1/popups/statswith{"b":[[id, vistas, cierres, clics, envíos], ...]}(the URL arrives inwindow.bosPopupsU). The route accepts at most 10 rows, each number between 0 and 50, and only IDs of existing popups; malformed batch = 400; more than 600 requests per minute across the whole site = 429 (a global limit, not per IP); accepted = 204. - Consent: the count is anonymous and aggregated, so it doesn’t wait for the banner. The
dataLayereventspopup_view,popup_closeandpopup_convert(withpopup_idandpopup_name) do require Analytics (window.bosCk('a'); with no banner they’re sent). Preview doesn’t count or emit events. - List: a «Views · Conversion (30 days)» column with the views sparkline (
Builder_OS_Board::spark); the detail goes in the title. - A/B: goal «Popup conversion» (
{"type":"popup"}, no value), only in popup tests: it counts whenbos:popup-convertfires for the test’s popup.
Segmentation. conditions settings, evaluated in the browser, which are added (AND) to pages, devices, users, frequency and dates, and apply to automatic opening (not to opening by click or API).
| Key | Values | Effect |
|---|---|---|
utm_key, utm_value | key (utm_source) and text the value must contain (lowercase) | Matches if the current URL or the visit’s landing URL carries the parameter. Empty value: it only has to exist. |
referrer, referrer_domain | any, google, social, direct, domain + domain | Traffic source (referrer of the visit’s first page). domain: the domain contains the text. |
visitor | all, new, returning | New = first visit; returning = there was a previous one. |
min_pages | 0–50 | Shown from the Nth page view of the visit (0 or 1 = no condition). |
- Browser storage (no cookies): the visit counter goes in
localStorage(bos-popup:visits; if unavailable, insessionStorage) and the visit context (landing URL parameters, referrer domain, page views and visit number) insessionStorage(bos-popup:ctx). With the built-in banner active they’re only written if the visitor accepted Preferences or Analytics; without that consent nothing is saved and the visitor counts as new, with 1 page view, and the UTM and referrer come from the current page. With no banner, or with a third-party consent tool, they’re written on load. They aren’t cookies and never leave the browser. Without storage (private mode), conditions are evaluated with that page’s values. - Limit: the visitor type and the page count only include pages where some popup applies (that’s where the JS is loaded).
- The HTML adds only the keys of the active conditions to the popup’s configuration:
utm: [clave, valor],ref: "@google"|"@social"|"@direct"|dominio,vis,pvandname. There’s no extra request. - Editor («Popup: where it is shown» panel): «Visitor type» (Everyone, New, Returning), «Traffic source» (Any, From Google, From social networks, Direct, From a domain…, with «The referrer contains»), «URL parameter» (with «The value contains») and «After N page views in the visit». The «Where» column of the list summarizes them.
- MCP and packages:
popups_update_settingsandbos.json(«popups».conditions, validated withsanitize_settings) accept the new keys inconditions, e.g.{"conditions":{"utm_key":"utm_source","utm_value":"facebook","visitor":"new","min_pages":2}}.
Accessibility
- Dialog with
role="dialog",aria-modaland an accessible title (the popup’s first heading). - When it opens, focus moves into the popup; Tab doesn’t leave it (modals) and the rest of the page becomes inert; the page doesn’t scroll behind it.
- Esc closes it, as does the close button (always visible, 44 px) and, if enabled, a click on the backdrop. When it closes, focus returns to the button or link that opened it.
- The entrance animation is disabled with “reduce motion”. Without JavaScript, popups aren’t shown (they never cover the content).