Integrate WebChat 2.0 FrontEnd into Wordpress
Note
An Enterprise license or higher is required to access these features.
Introduction
The WebChat application can be added to your Wordpress by adding some scripts to your template. The scripts will load WebChat into your page.
Enable webchat into Wordpress
-
Login to your Wordpress admin center
-
Navigate to your Theme Customizer (Appearance > Customize)
-
Select Widgets and an available Footer slot (For example Widgets > Footer 1)
-
Add Custom HTML
-
You can use the demo page url provided by your AnywhereNow representative and add /webchat.bootstrap.js as the url to load the script.
Note
Without the correct configuration object the WebChat FrontEnd will by default be set to hidden. See the next step.
CopyHTML<script src="path/to/webchat/webchat.bootstrap.js"></script>
<script> WebChat.load() </script> -
With the following Typescript definition of the configuration object:
Note
We will discuss the various properties of this configuration object in additional configurations, see: WebChat 2.0 for WebAgent Additional Configuration
CopyScriptinterface Configuration {
teaseMessageSettings?: TeaseMessageSettings;
templates?: Templates;
parent?: HTMLElement;
} -
Save the Page.
Example with configuration object to show the WebChat FrontEnd
<script src="path/to/webchat/webchat.bootstrap.js"></script>
<script>
const config = {
available: {
state: 'Enabled'
},
away: {
state: 'Enabled'
},
busy: {
state: 'Enabled'
},
offline: {
state: 'Enabled'
}
};
WebChat.load(config);
</script>