- The
mxfield that lets you filter out widget events coming from MX. - The
typefield that identifies what the event represents at a high level. - The
metadataobject field that has information related to thetype.
Example Integration
Events in Mobile WebViews
MX has developed a URL-based updating mechanism to replace event messages that are available to other desktop implementations. You can capture this URL and use the information provided in it to build the necessary logic for coordinating application events. When requesting a widget URL, you must include theis_mobile_webview field with a value of true in your request to access WebView event messages. If you don’t want to handle these events, either set the is_mobile_webview value to false or don’t include this flag.
For the Micro Insights Widget, this URL is delivered via a window.location = "mx://pulse/micro-carousel/cta?metadata=<metadata as an encodedURI JSON string>" call within the iFrame. You must capture this URL, parse out the path and query string, then JSON decode the metadata field. When decoded, the metadata contains the beat_guid, beat_template, and user_guid fields.
Application Events
Widget Load
This event triggers when the widget loads.Widget Ping
This event keeps the widget session alive.Widget focusTrap
This event is triggered when popover content which traps the focus onto a particular element is opened or closed, but only in the case that no other popover content is already open. This event is triggered by some drawers, menu buttons, and modals.Insights Widget Events
When displayed in the Insights Widget, some insights contain a call to action (CTA) that directs the user to the appropriate location by default, but others require you to send the user somewhere else to complete an action. Here’s the process:- We detect that a user has selected a CTA on one of our insights that requires you to send the user somewhere outside of our widget.
- We send you a UI event to let you know that a user has selected this CTA. Each event contains base metadata fields, and some events contain fields specific to individual insight templates. Refer to Table 1 for details about these fields.
- The listener you create for this event sends the user to the appropriate location within your mobile app or website based on the details we sent through the UI event.
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 UI 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
metadata includes a beat_guid. Use this GUID in your widget URL request for the Insights Widget so the specified insight shows at the top of the insights feed. See Move Insight to Top of Feed for more info.
Here’s an example of what this event looks like:
Example

