Introducing JavaScript Hooks

Great news! We’ve added JavaScript hooks to Widgetbird, allowing you to execute custom code when specific events happen. This gives you more control over how the widget interacts with your website.

What’s new?

With this update, Widgetbird now dispatches custom events that you can listen for in your own JavaScript code. Here are the key events:

  • widgetbird-open – Fires when the widget opens.
  • widgetbird-close – Fires when the widget closes.
  • widgetbird-open-integration – Fires when an integration opens, including the integration ID in the event details.
  • widgetbird-show-popup-text – Fires when a popup text is displayed.
  • widgetbird-hide-popup-text – Fires when a popup text is hidden.
  • widgetbird-close-integrations – Fires when integrations are closed.
  • widgetbird-close-popups – Fires when popups are closed.

How to use these hooks

You can listen for these events and execute custom code by adding an event listener in your JavaScript:

document.addEventListener("widgetbird-open", function() {
    console.log("Widgetbird was opened!");
});

This makes it easy to track interactions, trigger custom analytics events, or customize your user experience based on widget activity.

Start using these hooks today and enhance your Widgetbird setup!

Chirps,
Roy