Embedding the Web Messaging widget in a native Pega Platform application
Provide another way for customers to interact with your Pega Platform application by embedding the Web Messaging widget in the application's existing harness or a new section. As a result, customers can more efficiently ask for help, find information, or report an issue, by using a Digital Messaging chat window in your application.
When you embed the Web Messaging widget in your application, you use the same JavaScript function that is defined Installation tab of Digital Messaging Manager.
There are two ways to embed the Web Messaging widget in your application.
- Edit a harness and embed the widget:
- Switch to Dev Studio.
- Open the application that contains the harness where you want to add a
Web Messaging widget, and then edit the harness
rule.For more information, see Harnesses.
- In the harness rule, click the Scripts & styles tab.
- in the Scripts section, click Add a row.
- In the new row, in the Name column, enter webWidgetInstallation, and then click Edit.
- Click Create and open.
- In the webWidgetInstallation text file rule, on the Main tab, in the text area, enter the JavaScript code from the example below to insert the Web Messaging widget.
- In the JavaScript code, replace the value for
script.src
with the JavaScript function value in thesrc
attribute obtained from the Installation tab of your Web Messaging channel in Digital Messaging Manager. - Click Save.
- In the harness rule, click Save as, and then create a copy of the harness rule in your application ruleset.
- Switch back to App Studio.
- Create a section and embed the widget:
- Switch to Dev Studio.
- In the application where you want to add the Web Messaging widget, create a section rule.For more information, see Creating sections.
- In the section rule, click convert to full screen editor, and then in the Confirm section conversion dialog box, click Submit.
- Click the HTML tab.
- Clear the Auto-generated HTML checkbox.
- In the HTML source field, enter a script tag
from the example below to link to the Web Messaging
widget, replacing the
src
attribute value with the JavaScript function obtained from thesrc
attribute value from the Installation tab in Digital Messaging Manager. - Click Save.
- Switch back to App Studio.
Include the Web Messaging widget in a harness
Include the Web Messaging widget in a section
Previous topic Passing website language using PegaChatTags Next topic Enabling virus scanning for Web Messaging