Hi Fagana. I think I know what's wrong. The reason Qualtrics is blocking the widget is because the chat file is loading from a URL that’s not on Qualtrics’s approved-domain list (*.ngrok-free.app is not allowed), so the browser refuses to run it. That's why it works when you test it on your end, but not when on Qualtrics. See Qualtrics’s allow list here:
https://www.qualtrics.com/support/getting-started-qualtrics/allowlisting-external-domains-for-qualtrics-use/#DomainListThere is often overlap between the network allow-list IT needs for your university to use Qualtrics as well as the Content-Security-Policy (CSP) allow list that Qualtrics sends with every survey page. The purpose of this is it tells the browser which external origins are allowed for script-src, img-src, connect-src, frame-src, etc.
The good news is, instead of ngrok you can use unpkg.com which is an already-approved host for the file on that list.
If you publish the chat-widget file to unpkg, Qualtrics will load it without complaint (assuming the CSP allow list hasn't been tightened beyond the default). Your research data still flows only to your university server and unpkg just delivers the static file.
This is what I'd do:
- Ask Qualtrics's technical support team if it's a permissions issue with ngrok-free.app in the code and if the whitelisted unpkg.com would fix this issue. If so;
- Ask your developer to bundle the chat widget into a single “.min.js” file, which I believe is already available on anythingllm.
- Publish that file to npm (it shows up automatically on
https://unpkg.com/…) Publishing to npm/unpkg exposes only the static JavaScript file, not any participant data or credentials.
- Change the src in your Javascript so it points to the unpkg URL instead of the ngrok URL.
These steps avoid rewriting your RAG logic, keep everything inside the Qualtrics flow, widget’s API calls and data will still go to the university server and satisfy the security review with no third-party cookies or trackers added. Let your developer handle the publish-to-unpkg step, once that URL is live, swap it into the survey and test again.
If this doesn't fix the issue, we need to look for another error message.
In Qualtrics click Preview so the survey loads in a new tab. Right-click anywhere on the page and choose Inspect to open developer tools. This tab shows all warnings and errors produced while the page loads. Refresh the page, this will run every script again and re-print any security errors / warnings. Check both console and network tabs for error messages, keep an eye out for a CSP error. That should point to the exact issue. May be worth doing this before trying the unpkg fix. If there are no errors, if you haven't already, ask Qualtrics if they can elaborate on why the provided Script is wrong even though it runs fine when tested on your end.
Hope this helps! :)