# Add live chat support

We do not provide live chat functionality directly. However, you can integrate
external live chat tools with our forms.


EASY METHOD

The easy way is to use the Links Type [/article/1038-links-type] inside your
conversation to leave links to an external live chat tool. The other tool opens
up in a new tab and the user can continue the form conversation, in case all
your agents are offline.



You can also leverage your social channels, like Facebook, Instagram, Telegram,
Slack for the live chat using the same method.


DEVELOPER METHOD

If you have a developer on the team, then you can invoke a live chat widget when
user opts for such an option in the conversation.



First add a Multi Choice Type [/article/1029-multi-choice-type] question type to
your conversation, to see if user needs immediate assistance.



In the Logical Jump [/article/1020-logical-jump] settings of this message, point
the answer Yes to End of conversation.



This ensures that the form will send a completed response containing all the
previous messages from the user.



Now, add a piece of a script to your webpage to check if the user responded to
this message with an answer, "Yes" using the JavaScript method, collectchat.on
[https://developers.collect.chat/#/callbacks?id=collectchatonevent-function] for
the message event. Then you can remove the form from the page, using
the collectchat.unload
[https://developers.collect.chat/#/actions?id=collectchatunload] method and
invoke the live chat widget using it's API.



Here is the example using Tawk.to API. details.question points to the ID of the
question being asked, which will be unique for each question.

<script>
var collectchat = window.collectchat || {};
collectchat.ready = function() {
  collectchat.on('message', function(details) {
		console.log(details); // remove this after debugging
    if (details.question === "A1895B5D-0ABA-4636-93A1-4ED9C2E0B793" && details.answer === "Yes") {
          console.log('user opted for immediate assistance');
          // Remove form launcher and widget
          collectchat.unload();
          // Toggle widget status of Live chat widget here
          Tawk_API = window.Tawk_API || {};
          Tawk_API.toggle();
    }
  });
}
</script>



Note



In both demos, you can see that it's a "Form-First" approach. The form interacts
with the user and collects their details initially and only near the end of the
conversation, we ask the user if they need live support. This way even if your
agents are offline, the form is able to capture user data and send it to you.