Issue with redirecting participants to Qualtrics survey at the end of experiment

Participants are redirected to a qualtrics survey at the end of our online experiment. A dialog box appears that the participants click on to go to qualtrics. However, 4 out of 10 participants in our pilot study weren’t redirected. Is there an issue on our end or is this some browser settings issue? We use this for redirecting participants -
on_finish: function () {
window.location.href = "https://…
}

Try following this guide:

Issac

According to Pavlovia your code should look like:

var pavlovia_finish = {
      type: jsPsychPavlovia,
      command: "finish",
      on_finish: function (){
                  document.body.innerHTML = '<p> Please wait. You will be redirected back to Prolific in a few moments. 
                  If you get a pop-up warning you "data may not be saved", you can click "leave", your data have already been saved.</p>';
                  setTimeout(function () {
                    location.href = "https://...";
                    document.body.innerHTML ='<p>If you are not automatically redirected, please click here: 
                    <a href="https://...">https://...</a></p>
                    <p>If you get a pop-up warning you "data may not be saved", you can click "leave", your data have already been saved.</p>';
                  }, 5000);
                }
      };