Popups and forms
Control which popup shows, how often, and where its creative comes from.
Popups and forms
Several systems can open a popup on this store. A popup manager in the theme decides which one shows, and it is the only code that tracks all of them.
| What | Owner |
|---|---|
| Popup creative, copy, targeting rules | Klaviyo |
| Whether the manager runs at all | Theme settings, Popup Manager |
| Popups hidden before the page loads | Theme settings, Popup Manager blacklist |
| Need Help popup image, title, buttons | Theme settings, Need Help Finding Something Popup |
| Product page Offers button and popup IDs | Theme settings, Klaviyo |
| Which Klaviyo form is the sitewide signup | Repository code |
How the manager decides
At most two popups show per page view. Only one is visible at a time.
The first popup is offered five seconds after the page loads. After that, a timer offers the next one every fifteen seconds, and the timer restarts whenever a popup closes so the gap is always a full interval.
Each popup carries a priority. A higher-priority popup can replace one that is already open. A lower-priority one waits.
A popup can be marked to force itself open, which skips the per-page limit. The Need Help popup uses this when a customer clicks its trigger.
Turn the manager on or off
- In the theme editor, open Theme settings, then the Popup Manager group.
- Toggle Enable popup manager.
- Save.
Switching it off does not remove Klaviyo popups. It removes the coordination between them, so Klaviyo's own rules decide, and two popups can appear together.
Hide a popup that should never show
The blacklist hides known popups before the page renders, which stops a flash of an unwanted popup.
- In the theme editor, open Theme settings, then Popup Manager.
- Add one line per popup to Blacklist, in the form
selector,type.
QTuEQs,klaviyo
#popup-selector,customFor a Klaviyo popup the selector is the form ID. For anything else it is a CSS selector.
- Save.
Edit the Need Help popup
This popup is built in the theme rather than in Klaviyo, so all of it is editable in theme settings.
- In the theme editor, open Theme settings, then Need Help Finding Something Popup.
| Field | What it does |
|---|---|
| Popup Image (Desktop), (Mobile) | Artwork for each breakpoint |
| Popup Title | Heading |
| Call To Action 1 to 3 | Up to three buttons |
Each button has four fields. Call To Action is the label. Element ID is the id used to target the button, which analytics and other scripts rely on, so change it only if you know what reads it. Call To Action Link is the destination. Type selects the button behaviour.
- Save.
The popup also has a Need Help Popup section that controls where it renders. Both have to be present for the popup to appear.
Edit the product page Offers popup
- In the theme editor, open Theme settings, then the Klaviyo group.
| Field | What it does |
|---|---|
| Enable Offers CTA and Popup on standard PDP | Switch for regular product pages |
| Enable Offers CTA and Popup on Medispa PDP | Switch for MediSpa product pages |
| CTA Label | Button text |
| Display mode | How the popup opens |
| Klaviyo Popup ID (Desktop), (Mobile) | The Klaviyo form each breakpoint opens |
The MediSpa group of the same settings repeats these fields for MediSpa pages generally, separate from MediSpa product pages.
- Save.
Get the Klaviyo Popup ID from the form's URL in Klaviyo. It is the short code at the end, such as UBRZB9.
Change the sitewide signup popup
This one needs a developer. The Klaviyo form IDs for the sitewide signup are written into the theme's source rather than into theme settings, and they are mapped per market.
Ask a developer to edit src/components/popup-logic/definitions/sign-up-forms.ts for the main store and
sign-up-forms-medispa.ts for MediSpa pages. Both need a rebuild and a deploy.
Business rules
The sitewide signup popup is suppressed on MediSpa pages, and the MediSpa signup popup is suppressed everywhere else. A
page counts as MediSpa when its body carries the template-medispa-v2 or medispa-lp class, or when the product's
vendor name contains medispa.
Form IDs are chosen per market, falling back to a default entry. A market with no mapping gets the default form rather than no popup.
Verify the change
- Open the storefront in a private window, because popup frequency is tracked per browser.
- Wait five seconds for the first popup.
- Close it and wait fifteen seconds for the second.
- Confirm no third popup appears.
To watch the manager's decisions, append ?ba_debug=popup-logic to the URL and open the browser console. The manager
logs which popup it offered and why one was refused. Full detail is in Debug logging.
If a popup appears at the wrong moment, follow Popup shows at the wrong time.
Developer map
| Concern | Source |
|---|---|
| Manager, priority and per-page limit | src/components/popup-logic/index.ts |
| Bootstrapping and timings | src/entrypoints/popup-logic.ts |
| Timer | src/components/popup-logic/timer.ts |
| Klaviyo detection | src/components/popup-logic/sniffers/klaviyo.ts |
| Theme popup detection | src/components/popup-logic/sniffers/custom.ts |
| Sitewide signup form IDs | src/components/popup-logic/definitions/sign-up-forms.ts |
| MediSpa signup form IDs | src/components/popup-logic/definitions/sign-up-forms-medispa.ts |
| Need Help popup | src/components/popup-logic/definitions/need-help-popup.ts |
| Blacklist rendering | snippets/popup-logic.liquid |