Dynamic web pages based on user choice

Dynamic web pages based on user choice

You can add interactions on your web page based on how the user interacts with your chatbot. Let's say, user clicked on "Play video" in a Multi Choice message. Then you can use the JavaScript method, collectchat.on to be triggered when user makes such a selection.

<script>
var collectchat = window.collectchat || {};
collectchat.ready = function() {
  collectchat.on('message', function(details) {
    console.log('User responded to question', details.question, details.answer);
  });
}
</script>

Here, details.question will have the question that was posed to the user and details.answer will contain the reply given by the user to the chatbot. You will have to write your own code to play the video based on the message user interacted with.

Other possible use-cases are:

  • Redirecting user to a different page of the website

  • Creating an interactive tutorial to educate your user

  • Scrolling to a section of the webpage

Note

You will need the help of a developer to do this.



Still need help?

Contact us

Customize