If you'd like to send Customerly events to an outside platform or customize Customerly using specific events, you can use our Live Chat API.
First Inizialize your Customerly Live Chat script.
These are the callbacks you can use as you need.
If you want to be notified from the live chat when someone instances a new conversation with you, you can use the onLeadGenerated callback.
The function returns:
customerly.load({ app_id: "REPLACE_APP_ID", callbacks: { onLeadGenerated: function( email ) { … }, } });
The onChatOpened callback will be triggered when the client opens the chat window. Ideal if you want to control the live chat icon after they open the chat window. (To control the chat window please refer to the tutorial here)
customerly.load({ app_id: "REPLACE_APP_ID", callbacks: { onChatOpened: function() { … }, } });
The onChatClosed callback will be triggered when the client closes the chat window. Ideal if you want to hide the live chat icon after they close the chat window. (To close the chat window please refer to the tutorial here)
customerly.load({ app_id: "REPLACE_APP_ID", callbacks: { onChatClosed: function() { … }, } });
The onNewConversation callback will be triggered when a user or a lead start a new conversation. Ideal if you want to track in Google Analytics or other analytics service you use the pages with more conversation opened.
The function returns:
customerly.load({ app_id: "REPLACE_APP_ID", callbacks: { onNewConversation: function( message ,attachments ) { … }, } });
The onProfilingQuestionAnswered callback will be triggered when the lead answer to any of the profiling questions.
The function returns:
customerly.load({ app_id: "REPLACE_APP_ID", callbacks: { onProfilingQuestionAnswered: function( attribute, value ) { … }, } });
The onProfilingQuestionAsked callback will be triggered when any of the profiling questions have been shown to the visitor.
The function returns:
customerly.load({ app_id: "REPLACE_APP_ID", callbacks: { onProfilingQuestionAsked: function( attribute ) { … }, } });
The onRealtimeVideoAnswered callback will be triggered when the client answers a Realtime Video Call.
customerly.load({ app_id: "REPLACE_APP_ID", callbacks: { onRealtimeVideoAnswered: function() { … }, } });
The onRealtimeVideoRejected callback will be triggered when the client rejects a Realtime Video Call.
customerly.load({ app_id: "REPLACE_APP_ID", callbacks: { onRealtimeVideoRejected: function() { … }, } });
The onHelpCenterArticleOpened callback will be triggered when the client opens a Help Center Article within the live chat widget.
The function returns:
The article payload consists in:
customerly.load({ app_id: "REPLACE_APP_ID", callbacks: { onHelpCenterArticleOpened: function( article ) { … }, } });