{ if (typeof Ya === 'object' && typeof Ya._metrika.counter === 'object') { Ya._metrika.counter.reachGoal(name, params); } }); } if (['complete', 'loaded'].includes(document.readyState)) { setTimeout(() => initYM(), ); } else { document.addEventListener('DOMContentLoaded', () => { setTimeout(() => initYM(), ); }); }