Methods
- The following methods can be used by the developers, in your code to customize the behavior of the Chats as per requirement.
- This method will initiate the Skara Chats with the information provided by you as a form of an object. You can call this method in the situation where contact/visitor is not logged in when the page is loaded. You can also use this method to update the information of the contact that is logged in. Verify your contact by calling this method and passing the email in user_id, for example in your customer’s login page call this method when the login button is clicked.
- This method clears the Skara Chats session of the contact/visitor. Call this method when the user logs out from your application. Otherwise, the cookies will keep tracking new events for the user who was logged in before from the specific machine.
- This method is used to update the data of existing contact, which is logged in from the widget side. You can update the name, email, or any other data of contact fields that Salesmate provides, but you must provide the user_id with the data you wish to update.
- This method hides the Chats if it’s open. It will not hide the Chats launcher button. For example, you can configure your page in such a way that when the user clicks outside the Chats, this method is called.
- This method shows the Chats. It will try to open Chats last available state; otherwise, it will open the home screen. For example, you can call this method when the page reloads or when a certain button is clicked to open the Chats for promoting your visitors to chat.
- This method opens up Skara Chats and displays the conversation list.
- This method opens up Skara Chats and displays the screen to start a new conversation. Also if you provide a message as a parameter then the editor will come up preloaded with your message.
- This method helps you to track new events which visitor/contact performs on your website. You can also add further information to this event which will be visible inside your Skara app. Read more about how to track events inside Skara.
- This method is used to hide or show the Chats launcher button on your website. If you need to hide or show the launcher on some specific pages of your site then this method can be used.
- This method enables you to define any custom id or class of the HTML elements where, if your website visitor clicks then it will open the Chats launcher.
- Listen to the following events emitted by the Chats for executing any additional code that’s required.