If you integrated using the Widget Loader, please reference the Widget Loader Configurations guide.
Integrate PFM Widgets on a Website
To integrate the widget on a website using aniframe:
1
Create an iFrame
Create an
iframe. Set the width and height to 100%.For more information about widget sizing, reference the widget’s supported dimensions.2
Generate a Widget URL
Create a backend endpoint that calls the Platform API to generate a widget URL. Set the
widget_type to your desired widget; reference the list of widget types for the acceptable values.3
Create Listeners for Widget Events
Depending on the widget you’re integrating, you may have to create additional event listeners:
- If integrating the Money Dashboard Widget, you must create listeners for all the Money Dashboard Widget events, which includes all the Connect Widget’s widget events.
- If integrating the Connections Widget, you must create listeners for all the Connections Widget events, which includes all the Connect Widget’s events.
- If integrating the Mini Finstrong Widget, you must create listeners for all the Mini Finstrong Widget events.
4
Optional: Deep Link Embedded Widgets
If you’re using the Money Dashboard Widget and other Mini Widgets, you can configure it to deep link other embedded Mini Widgets to their full views. For example, selecting the View All button on the Mini Spending Widget should redirect the user to the full Spending Widget within the Money Dashboard. Similarly, clicking the call-to-action (CTA) button on any embedded Mini Widget should take the user to its corresponding full view.To create a deep link, use the Platform API’s request widget URL endpoint and follow these steps:
- Set the
widget_typefield tomoney_dashboard_widget. - Set the
widgetfield to your desired Mini Widget.
Integrate PFM Widgets on a Mobile App
To integrate the widget on a mobile app:1
Generate a Widget URL
Create a backend endpoint that calls the Platform API to generate a widget URL. Set the
widget_type to your desired widget; reference the list of widget types for the acceptable values. Include the is_mobile_webview field with a value of true.2
Load the URL into a WebView
Load the
widget_url.url returned in the Generate a Widget URL step into a WebView.3
Capture URLs for Application Events
Capture and parse URLs delivered via
window.location = "someurl" calls for the application events. See Events in Mobile WebViews for more details.4
Capture URLs for Additional Events
If you’re integrating the Connections Widget or Mini Finstrong Widget, you’ll need to capture and parse URLs for additional events. For more information, see Widget Events.
Common PFM Widget WebView Problems
This section covers some common problems with loading a widget URL into a WebView.Minimum Size
Minimum Size
To embed our mobile widgets into a WebView, we require a device width of at least 320 pixels. Depending on the implementation of the WebView, smaller devices may not be provided the full width, leading to display issues.
To experience the full responsive nature of our application, don’t restrict the available browser width by adding margins or padding.
WKWebView vs. UIWebView (iOS)
WKWebView vs. UIWebView (iOS)
Default Padding (iOS)
Default Padding (iOS)
By default, iOS adds additional padding to its WebViews, which sometimes causes problems.To fix this:
- Select the WebView providing the widgets in your application and navigate to the size inspector.
- Change the layout margins from
"Default"to"Explicit". - Update the left and right margins to
0. - Ensure the width is at least 320 pixels.
Default Margin (iOS and Android)
Default Margin (iOS and Android)
Whether using WebViews on Android or iOS, most browsers will have a default margin (set in the user agent stylesheet) on the body element when rendering the HTML page responsible for loading a widget. This margin is deducted from the total available width of the containing element, which will cause a problem.To fix this:
- Determine the computed width available on the
bodyelement. The width available to theiframecan be confirmed by inspecting theiframeinjected by MX and typingwindow.innerWidthin the JavaScript console. The width available to theiframemust be at least 320 pixels. - Confirm the
bodyandhtmlelements have their padding and margin set to0.
Viewport (iOS and Android)
Viewport (iOS and Android)
For mobile widgets to render correctly, the viewport must be set in a meta tag on the HTML page used to load the widget URL.The viewport is the size of the window through which a page is seen. It can be smaller or larger than the actual size of a page or device screen.On most mobile devices, the virtual viewport is larger than the actual screen size; web pages are rendered according to the viewport size, then shrunk down to the actual screen size. This helps when viewing pages that aren’t optimized for mobile, but for pages that are optimized for mobile (like the mobile widgets), the viewport meta tag is used to guarantee that the page is rendered properly.Set a meta tag within the
<head> element as follows:Example

