Hi All,
We have a survey that is currently being triggered using JavaScript to manually load our survey instead of the usual page load method. Additionally, we've integrated a QM script which provides session links, session cookies, and user cookies. However, we've encountered an issue where we're not receiving any values for the QMREPLAY.
I think it’s the way we are capturing QMREPLAY using the Javascript.
Here is the JS
Qualtrics.SurveyEngine.addOnload(function() {
/* Set QM Cookies that were passed via the Qualtrics Intercept */
var session = Qualtrics.SurveyEngine.getJSEmbeddedData('QMSESSION');
var user = Qualtrics.SurveyEngine.getJSEmbeddedData('QMUSER');
document.cookie = "QuantumMetricSessionID=" + session;
document.cookie = "QuantumMetricUserID=" + user;
/* Load the QM tag */
var qtm = document.createElement('script');
qtm.type = 'text/javascript';
qtm.async = 1;
qtm.src = 'https://cdn.quantummetric.com/qscripts/quantum-aa.js';
var d = document.getElementsByTagName('script')a0];
!window.QuantumMetricAPI && d.parentNode.insertBefore(qtm, d);
/* Wait for QM to Load */
function onStart() {
/* QM Finished Loading Set QM Replay Link in Qualtrics */
var qmReplay = window.QuantumMetricAPI.getReplay();
Qualtrics.SurveyEngine.setJSEmbeddedData("QMREPLAY", qmReplay);
}
if (!window.QuantumMetricAPI) {
window.QuantumMetricOnload = function() {
window.QuantumMetricAPI.addEventListener('start', onStart);
};
} else {
window.QuantumMetricAPI.addEventListener('start', onStart);
}
});
Qualtrics.SurveyEngine.addOnReady(function() {});
Qualtrics.SurveyEngine.addOnUnload(function() {});
If someone has any insights on how to fix this, would be greatly appreciated.