Skip to main content
When certain events trigger in our UI, we send you a widget event containing the information you need to respond in your codebase. You’re responsible for adding a listener that captures these events’ properties and handles what happens next. For an overview of which insights need your support and why, see Calls to Action.

Listen for Events

Don’t use widget events to sync data between platforms. Webhooks are a more reliable way of coordinating events between your servers and MX servers.
Widget events from MX have the following properties:
  • The mx field that lets you filter out widget events coming from MX.
  • The type field that identifies what the event represents at a high level.
  • The metadata object field that has information related to the type.
Here’s an example integration that listens for our events:
Example Integration
If you integrate on mobile through a WebView, events are delivered as URLs instead. See Events in Mobile WebViews.

Application Events

Widget Load

This event triggers when the widget loads.

Widget Ping

This event keeps the widget session alive.

Widget focusTrap

This event triggers when popover content that traps focus on a particular element opens or closes, but only if no other popover content is already open. Some drawers, menu buttons, and modals trigger this event.

Call to Action Events

While some insights contain a call to action (CTA) that MX handles inside the widget, others require you to send the user elsewhere to complete an action, such as your transfer flow. Here’s the process:
  1. We detect that a user selected a CTA that requires you to send them outside our widget.
  2. We send you a widget event indicating the user selected this CTA. Each event contains base metadata fields, and some events contain fields specific to individual insight templates.
  3. Your listener uses the event details to send the user to the appropriate location in your mobile app or website.
Table 1. Event fields
You must create listeners for each of the insight templates described in Table 2 that MX has enabled for you.
Table 2. Templates and associated actions

Micro Insights Widget Events

The Micro Insights Widget has two widget events. One event triggers when the user selects the View all CTA in the Micro Insight Widget’s header. If you have the header enabled, you must add a listener for this event that sends the user to the Insights Widget. Here’s what this event looks like:
Example
The other event triggers when the user selects the Read more CTA. You must add a listener for this event that sends the user to the Insights Widget. In this event, the metadata includes a beat_guid. Include this GUID in your Insights Widget URL request to show the specified insight at the top of the insights feed. See Move Insight to Top of Feed for more info. Here’s an example of this event:
Example