Hidden Pre-Chat in Messaging for Web
To learn about and set up hidden pre-chat, see Customize Pre-Chat for Messaging for In-App and Web.
This section describes the steps you must take from your web client to send user data, also known as hidden pre-chat data, to Salesforce. See the associated documentation for each step of this sequence.
- Before you initialize the API from the code snippet that we provide, add an event listener for
onEmbeddedMessagingReady. This method notifies you when the API is ready for requests.
- At some point after the
onEmbeddedMessagingReadyevent is dispatched, pass hidden pre-chat fields to Salesforce using
This sample code illustrates how you can implement the key steps of this sequence.
The Messaging for Web reference documentation describes these methods in more detail.