Availability-aware CTA
Show a “talk to us now” button only while the team is reachable, and a fallback otherwise:
function syncButtons(isAvailable) {
document.querySelector('[data-available]')?.classList.toggle('hidden', !isAvailable);
document.querySelector('[data-unavailable]')?.classList.toggle('hidden', isAvailable);
}
GlimpzeWidget.on(GlimpzeWidget.events.AVAILABILITY_CHANGE, ({ isAvailable }) => syncButtons(isAvailable));
GlimpzeWidget.getStatus().then(({ isAvailable }) => syncButtons(isAvailable));Live human if someone's free, booking form if not
isAvailable only tells you the team is reachable (an agent is online — they may be mid-call, in which case the visitor queues). To branch specifically on whether a human can take a call right now, use agents.free — it excludes agents who are online but already in a call. These counts update live, so you can keep a CTA in sync via the AVAILABILITY_CHANGE event:
async function startTalk() {
const { agents } = await GlimpzeWidget.getStatus();
if (agents.free > 0) {
GlimpzeWidget.open(); // a human is free — open the widget
} else {
window.location = '/book-a-demo'; // everyone busy/offline — fall back
}
}Troubleshooting
GlimpzeWidget is undefined. The script loads asynchronously. Call API methods from a user interaction, or wait for glimpze:triggers-ready.
Prefill didn't fill a field. The prefillFields key must match a field name from getFields(). Check the console for the warning listing valid names, and confirm the field is enabled in the dashboard.
The launcher won't appear. If you loaded with &mode=api, that's expected — call GlimpzeWidget.open() yourself, or remove mode=api for the floating launcher.
Deep-link call opens but the camera/mic is blocked. Acquiring the mic/camera needs a user gesture, so trigger the deep-link from a click (not on page load) to let the browser show the permission prompt. This applies with or without skipSetup — skipping the device-check screen doesn't remove the browser prompt. If access is already blocked, the visitor can use the in-call “Allow access” banner to grant permission and retry.
Widget not loading at all. Verify the widget ID and that the script URL is reachable; check the browser console for errors.
Support
For help with implementation, contact Glimpze support — the fastest way is the Glimpze widget on this very site.