Unable to integrate Webgazer to Qualtrics | XM Community
Skip to main content

When I am integrating Webgazer to Qualtrics, I applied in header and in javascript I applied
webgazer.setRegression('ridge') /* currently must set regression and tracker */
.setTracker('TFFacemesh')
.setGazeListener(function(data, clock) {
counter = counter + 1;
if(data){
dataSampleX.push(data.x);
dataSampleY.push(data.y);
}

if(data && counter > 25){
 var avgX = parseInt(dataSampleX.reduce(getSum,0)/dataSampleX.length);
 var avgY = parseInt(dataSampleY.reduce(getSum,0)/dataSampleY.length);
 getAllBoxes({x:avgX, y:avgY});
 getAllBoxes(data);
 counter = 0;
 dataSampleX = l];
 dataSampleY = p];
}

console.log(data); /* data is an object containing an x and y key which are the x and y prediction coordinates (no bounds limiting) */
console.log(clock); /* elapsed time in milliseconds since webgazer.begin() was called */
})
.begin()
.showPredictionPoints(true); /* shows a square every 100 milliseconds where current prediction is */

The error I got was "webgazer.setRegression(...).setTracker(...).setGazeListener(...).begin(...).showPredictionPoints is not a function." I don't know how to deal with this. Does anyone get any ideas?

A trick I was turned onto by another developer at my current shop is throwing...
debugger;
into the JS in Qualtrics. You're in essence setting a breakpoint in the JS so you can step through the code and better see where exactly it's breaking/how far the code is getting. I don't know the first thing about webgazer, but you might get somewhere if you can see what's happening when Qualtrics calls this plugin.


Leave a Reply