startProactiveChat
Omnichannel for Customer Service offers a suite of capabilities that extend the power of Dynamics 365 Customer Service Enterprise to enable organizations to instantly connect and engage with their customers across digital messaging channels. An additional license is required to access Omnichannel for Customer Service. For more information, see the Dynamics 365 Customer Service pricing overview and Dynamics 365 Customer Service pricing plan pages.
Enables organizations to engage users by automatically inviting them to a chat conversation based on the configured rules. Organizations can use end-user data, user journey information, time spent on web page, and more to decide when to proactively engage customers through chat. Organizations can control the proactive chat experience using personalized trigger messages and configurable rules to define the target audience, time frame, and target location.
Syntax
Microsoft.Omnichannel.LiveChatWidget.SDK.startProactiveChat(notificationUIConfig: notificationUIConfigObject, showPrechat, { inNewWindow: inNewWindowValue });
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
notificationUIConfig |
Object | Yes | Allows you to pass UI configurations for proactive chat notification. This object lets you customize the notification, including the message to be displayed. |
showPrechat |
Boolean | No | Boolean flag to indicate whether prechat is shown if configured for the widget. The default value is true . |
inNewWindow |
Boolean | No | Decides whether to open the chat in a new window. This parameter resides within an options object. |
Important
If no message is provided in the notificationUIConfig
object, then the default message, "Hi! Have any questions? I'm here to help" gets displayed.
Return value
None
Example
window.addEventListener("lcw:ready", function handleLivechatReadyEvent(){
Microsoft.Omnichannel.LiveChatWidget.SDK.startProactiveChat(
{message: "Hi! How are you doing today? Do you wish to start a chat?"},
true,
{
inNewWindow: true
}
);
});
Related information
Live chat JavaScript API reference
Start a chat
Start a chat proactively