MB-230 practice question 30 of 35

A company enables custom context variables on a chat widget. Users report that the context variables are not being populated on new chats. You need to troubleshoot the issue by querying the event listeners. Which listener is required to be running?

Full set: 327 questions

Domain Implement and manage omnichannel

Answer options
A: setContextProvider Correct answer
B: startProactiveChat
C: startChat
D: getContextProvider
E: initializeNewConversation
Correct Answer:
A. setContextProvider
Explanation

The setContextProvider method from the Live Chat SDK JavaScript API is used to register a function that supplies custom context data to a chat session. This method must be called before a chat is initiated. If users report that context variables are not being populated, the most likely cause is an issue with the implementation of setContextProvider—either it has not been called, it was called after the chat started, or the function passed to it is not returning the data correctly. Therefore, troubleshooting must begin by examining the setContextProvider implementation.

Why Incorrect

B. startProactiveChat: This method is used to programmatically initiate a proactive chat with a user, which is unrelated to providing context variables for a standard chat.
C. startChat: This is an event that fires when a chat session begins. It is a result of the chat initiation process, not a method for providing data to it.
D. getContextProvider: This method is not part of the official, documented Live Chat SDK JavaScript API. The correct method for registering the context provider is setContextProvider.
E. initializeNewConversation: This is not a documented method or event in the Live Chat SDK API for managing custom context.

References

1. Microsoft Learn. (2023). Send custom context. In Dynamics 365 Customer Service documentation. This document explicitly states

"Your application can set the custom context provider by using the setContextProvider method. The setContextProvider method should be called before a chat is started..." It also provides the required code samples.

Section: "Send custom context"

2. Microsoft Learn. (2023). Live chat SDK JavaScript API reference. In Dynamics 365 Customer Service documentation. This official reference lists all public methods and events for the SDK. setContextProvider is listed as a method

while getContextProvider

startProactiveChat (as a listener)

and initializeNewConversation are not present.

Section: "Methods"

Scroll to Top