You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some sample code below, where ratios is a list of breakpoint percentages (of the page height) to track.
A similar utility could be written using airkit's inview module, to track events when specific elements enter view.
varratios=[0.3,0.6,0.9];varfunc=function(category,action,label){trackEvent(category,action,label);};window.addEventListener('scroll',function(){varscrollRatio=window.scrollY/(document.body.offsetHeight-window.innerHeight);for(vari=0;i<ratios.length;i++){if(scrollRatio>ratios[i]){varpercent=ratios[i]*100;func('EVENT NAME','EVENT ACTION',percent+'%');ratios[i]=200;// Some number out of bounds.}}});
The text was updated successfully, but these errors were encountered:
ratios
is a list of breakpoint percentages (of the page height) to track.The text was updated successfully, but these errors were encountered: