Inserting a Chatbot code into Qualtrics | XM Community
Solved

Inserting a Chatbot code into Qualtrics

  • 30 September 2021
  • 4 replies
  • 575 views

Hi everyone,
For my master thesis i would like to research chatbots. In order to do this i would like to have some sort of frame where participants are able to interact with a chatbot through some sort of embedded square in the survey. The research really focuses on interacting with the chatbot in that environment so i would like to apply the following script into a page so people can interact with it:

">https://static.landbot.io/landbot-widget/landbot-widget-1.0.0.js">




This script came directly from the landbot website, and i would like to know if it is possible to create a page where people see this embedded chatbot, so that they can interact with it. Unfortunately, i was not able to add this into qualtrics. Perhaps you guys could help me out, or present an alternative!

Thanks in advance!

icon

Best answer by ChiragK 30 September 2021, 13:22

View original

4 replies

Userlevel 2
Badge +8

Hi, Please add below JavaScript code into question
Qualtrics.SurveyEngine.addOnReady(function () {
    var $this = jQuery(this.questionContainer);
    jQuery(".QuestionBody", $this).append('

');

    function onLandBotWidgetLoaded() {
        var myLandbot = new LandbotFrameWidget({
            container: '#myLandbot',
            index: 'https://landbot.io/u/H-201854-TW0ZHY5GVEOKB963/index.html',
        });
    }

    var tag = document.createElement('script');
    tag.src = "//static.landbot.io/landbot-widget/landbot-widget-1.0.0.js";
    tag.onload = onLandBotWidgetLoaded;
    var firstScriptTag = document.getElementsByTagName('script')[0];
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
});

Hi Chirag,
That worked! Thank you so much!!
All the best!

Badge

Hey all,
I have the same challenge as Percy above. The code that ChiragK sent unfortunately does not work in the version with Javascript 3.0. Are there people who can help me with this?

This is the current script: 
">https://cdn.landbot.io/landbot-3/landbot-3.0.0.js">




I'd love to hear if anyone has a solution! 
Thanks a lot.

Badge +1

Hi, could you please show me your survey. What is the chatboot look like? Is it a pop-up chatbot or else?

Leave a Reply