Script:
widget.js — reads the site config and events from the API.
A floating toast notification will appear in the corner (bottom-left by default) cycling through recent
events.
Also includes a 💬 Feedback pill if show_feedback is enabled in the site
config.
Fetches /api/widget/:id/config &
/api/widget/:id/events
Script:
bar.js
Bars are fetched from /api/widget/:id/bars. Each active bar renders at the top or bottom of the
page.
Closed state is tracked in sessionStorage. Click "Reset Session" to re-show closed bars.
Fetches /api/widget/:id/bars
Script:
timer.js — looks for [data-popwis-timer="TIMER_ID"] elements on the page.
For inline display type, place this div and the timer will render inside it.
Floating and Bar display types appear automatically — no placeholder needed.
Script:
spin.js — requires both a Site ID and a Wheel ID.
If the wheel uses trigger: button_click, add this attribute to any button:
Script:
form.js
For inline display type, target elements use data-popwis-form="FORM_ID".
For button_click trigger, the same attribute triggers the popup.
Script:
exit-offer.js — Note: this script reads the siteKey from
script[src*="widget.popwis.net"], so in local testing use widget.js to provide the site key.
💡 After loading, move your mouse above the address bar (outside the viewport) to trigger the exit intent. You can also click "Force Trigger" below.
Fetches offers from /api/widget/:id/exit-offers. Matches current page path against
target_pages.
Uses localStorage to track show frequency (once/day, week, forever, session).
Fetches /api/widget/:id/exit-offers
Script:
cart.js
The cart script only activates on cart pages (URLs containing /cart, /checkout,
/basket, etc.).
To test locally, simulate the URL containing one of these patterns:
On a cart page, the script:
1. Generates a session ID (sessionStorage)
2. Watches for exit intent (mouse leaves top), back button, or tab close
3. Sends a POST to /api/widget/:id/cart/abandon via sendBeacon
4. On recovery pages (/thank-you etc.), marks the session as recovered.
Fetches /api/widget/:id/cart/config
window.Popwis('track', ...) and window.Popwis('identify', ...) to manually send
events.Requires
widget.js to be loaded first.
{ name, city, country }{ count: 42 }{ product: "Air Max", remaining: 3 }{ count: 18, hours: 24, action: "bought" }{ rating: 5, product: "Sneakers" }