Embed script options
Attributes the embed script accepts and how to control the widget from your page.
The standard embed script looks like this:
<script src="https://cdn.wiqly.io/widget.js" data-widget-id="your-token-here" async ></script>
Required attributes
src— alwayshttps://cdn.wiqly.io/widget.js. Served from Cloudflare with aggressive caching.data-widget-id— the widget'sembed_token. Find it in the dashboard on the widget detail page.
Recommended attributes
async— loads the script without blocking page render. Strongly recommended; the widget doesn't need to be synchronously available.
Defer instead of async
If you'd rather use defer:
<script src="https://cdn.wiqly.io/widget.js" data-widget-id="..." defer></script>
Either works. defer guarantees the script runs in document order; async doesn't. For Wiqly specifically this doesn't matter (no dependencies on other scripts), so either is fine.
Behaviour
Once loaded, the widget:
- Fetches its configuration from
/api/widget/{token} - Renders a floating bubble in the bottom-right of the viewport
- Starts the welcome video loop muted
- Waits for visitor interaction
Everything renders inside a Shadow DOM root, so your page's CSS doesn't affect it and vice versa. We use a single iframe-equivalent isolation strategy without actually using an iframe, which means analytics, the dialer (tel: links), and form submissions all behave like first-party interactions.
Multiple widgets on one page
Don't. Use one widget per page. Multiple instances of the script will register multiple bubbles in the same corner, which looks broken.
If you want different widgets on different pages, use a single embed script per page with different data-widget-id values.
Programmatic control
We don't currently expose a public JS API (no window.wiqly.open() or similar). If you need to:
- Trigger the widget to open from a custom button on your page
- Pre-fill the email form with a known visitor's email
- Listen for events from your page
…get in touch. The plumbing exists internally; we just haven't promoted it to a public API. We'll do that once we know what people actually want from it.
Conditional loading
Need to load Wiqly only for certain visitors (e.g. only logged-in users)? Just wrap the script tag in a conditional in your page template. The widget loads if the script tag is rendered; it doesn't load if it isn't.
<script src="https://cdn.wiqly.io/widget.js" data-widget-id="..." async></script>Removing the widget
Delete the script tag from your site. No cleanup required.