Developers

Recipes & troubleshooting

Proven integration patterns, and quick answers when something doesn't behave.

One widget, many custom buttons (API mode)

Load the widget in API mode and wire as many of your own buttons as you like — each can prefill different context:

<script src="https://api.glimpze.io/functions/v1/widget-loader?id=YOUR_WIDGET_ID&mode=api" async defer></script>

<button onclick="GlimpzeWidget.open()">Talk to sales</button>
<button onclick="GlimpzeWidget.open({ prefillFields: { topic: 'support' } })">Get support</button>

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
  }
}

Cookiebot consent-gated tracking

If you enable Integrations > Cookiebot > Require Cookiebot consent before live tracking, Glimpze delays visitor tracking heartbeats until Cookiebot statistics consent is granted. The widget, chat, and calls still initialize normally; only live visitor tracking (live feed, page-view trail, dashboard-initiated proactive outreach) waits for consent. With no Cookiebot present, tracking behaves normally.

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.