var loadedMetrica = false; window.addEventListener('scroll', loadMetrica); window.addEventListener('click', loadMetrica); window.addEventListener('mousemove', loadMetrica); function loadMetrica() { if (!loadedMetrica) { setTimeout( function(){ (function(m,e,t,r,i,k,a){ m[i]=m[i]||function(){ (m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(6661015, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); },500); } loadedMetrica = true; window.removeEventListener('scroll', loadMetrica); window.removeEventListener('click', loadMetrica); window.removeEventListener('mousemove', loadMetrica); };