Check if jQuery is enabled on the site - running the below snippet on the browser console will return the result.
(function() {
if (window.jQuery) {
// jQuery is loaded
return("Yeah! JQuery loaded");
} else {
// jQuery is not loaded
return("Nope, Doesn't Work");
}
})();
Create a custom javascript variable in GTM
function() {
var winHeight = jQuery(window).height();
var docHeight = jQuery(document).height();
var scrollTop = jQuery(window).scrollTop(); //NaN or zero at top
var trackLength = docHeight - winHeight;
var pctScrolled = Math.floor(scrollTop / trackLength * 100);
return pctScrolled;
}