Web Inbox Widget
How to integrate the out-of-the-box website widget for inbox messages
Last updated
How to integrate the out-of-the-box website widget for inbox messages
Last updated
Prerequisites
To integrate Message Inbox for websites, please follow the guide.
Web Message Inbox being integrated into your website increases conversions drastically. A ready-to-use Web Inbox Widget is out of the box subscribed to all methods needed to communicate with users. Just integrate the widget into your website and customize its appearance to fit your brand.
When initializing Pushwoosh WebSDK, add the inboxWidget
parameter:
To render the widget, you should specify a trigger element for the widget. Any DOM-element on the page could be the trigger. Specify its ID as “pwInbox” or assign any custom ID to the triggerId
parameter when initializing SDK.
When WebSDK is initialized, the unread messages badge displays on the trigger element. Once the trigger element is tapped, the widget appears on the page.
By default, the widget is located in the opposite direction from the screen border closest to the trigger element. You can set the widget’s position through configuration params:
By default, the inboxWidget
should be placed before the closing </body> tag.
Render the widget anywhere on the page as shown in the example below:
Search for a parent element is performed by querySelector, so it needs clear specification of a class, id, or element.
To customize widget text, add emptyInboxTitle
and emptyInboxText
parameters:
The result looks like this:
To customize the widget's appearance, use the following parameters:
Unread messages count badge can be customized as follows:
To customize text properties, add the following code:
Lastly, you can specify the icon for empty inbox:
To open or close the widget, use the following API method: