Redirect to a new website | XM Community
Skip to main content

At the end of the survey, I want to my survey to redirect my user to a new website but I want that site to open in a new tab. Ideally, I would do this through the redirect in an end of survey block, but if there is a way to do it in an end of survey message, that would work too.

However, if I use the end of survey message, I want the link to automatically redirect them after a few seconds; I don’t want the user to have to click the link. 

 

Thoughts? 

Hi @jmborzick There is a workaround which is very close to your use case.


STEP 1: You can create a text/graphic question saying ‘Thank you for filling out the survey, you will  now be redirected to our website.’ or anything as per your need and add JS to it which will auto advance after 5 seconds to the ‘End of Survey’ message and will also hide the next button. Below is the code.
 


Qualtrics.SurveyEngine.addOnload(function(){
 // Hide back button on this specific page 
this.hideNextButton();
 });

Qualtrics.SurveyEngine.addOnReady(function() {
    /*Place your JavaScript here to run when the page is fully displayed*/
    var qid = this.questionId;

    // Use setTimeout to wait for 5 seconds and then click the Next button
    setTimeout(function() {
        jQuery('#NextButton').click();
    }, 5000);
});

STEP 2: Select ‘End of Survey’ message options and add your desired URL.

 

This should work.


 

 


Another way is to use below script in end of survey message:

<script>
setTimeout(function(){ window.open('https://community.qualtrics.com/', '_blank'); }, 5000);
</script>End of survey message goes here.

 


@Shashi Thank you! This works perfectly, except, when instead of opening up the redirect link into just one new tab, it opens it up into two tabs. Do you have any idea why that might be happening?


For some reason my previous post is blank but it’s linked to a point I was addressing in it. You’re probably seeing 2 tabs because you’re previewing with both the desktop and the mobile views enabled.

Be aware that this solution will be blocked by most browsers’ default popup settings.


@Shashi Thank you! This works perfectly, except, when instead of opening up the redirect link into just one new tab, it opens it up into two tabs. Do you have any idea why that might be happening?

 Please test it using annonymous link which should open only one tab. Also as rightly said by

@vgayraud  - new tab open will be blocked by most browser. We can use below script to open in same tab if opening in same tab works for the use case:

<script>
setTimeout(function(){ location.href = 'https://community.qualtrics.com/';}, 5000);
</script>End of survey message goes here.

 


@Shashi & @vgayraud Thank you both for your assistance. Testing it outside of preview fixed the double opening. Regarding the new tab, thanks for the heads up. I was able to solve the issue by opening in _Parent instead. The problem was I was creating a website intercept and didn’t want the redirect website opening in the small intercept window. 


Leave a Reply