Commit e231adb4d5571c154f8e8e86dd4a1faa423299df
1 parent
5f856a0b6c
Exists in
master
fix yandex metric error
Showing 1 changed file with 15 additions and 6 deletions Side-by-side Diff
resources/views/layout/frontend.blade.php
... | ... | @@ -350,11 +350,21 @@ |
350 | 350 | @if(App::isProduction()) |
351 | 351 | <!-- Yandex.Metrika counter --> |
352 | 352 | <script type="text/javascript" > |
353 | - (function(m,e,t,r,i,k,a){m[i]=m[i]function(){(m[i].a=m[i].a[]).push(arguments)}; | |
354 | - m[i].l=1*new Date(); | |
355 | - for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} | |
356 | - k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) | |
357 | - (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); | |
353 | + (function(m, e, t, r, i, k, a) { | |
354 | + m[i] = m[i] || function() { | |
355 | + (m[i].a = m[i].a || []).push(arguments); | |
356 | + }; | |
357 | + m[i].l = 1 * new Date(); | |
358 | + for (var j = 0; j < document.scripts.length; j++) { | |
359 | + if (document.scripts[j].src === r) { | |
360 | + return; | |
361 | + } | |
362 | + } | |
363 | + k = e.createElement(t), a = e.getElementsByTagName(t)[0]; | |
364 | + k.async = 1; | |
365 | + k.src = r; | |
366 | + a.parentNode.insertBefore(k, a); | |
367 | + })(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); | |
358 | 368 | |
359 | 369 | ym(98897513, "init", { |
360 | 370 | clickmap:true, |
... | ... | @@ -365,7 +375,6 @@ |
365 | 375 | </script> |
366 | 376 | <noscript><div><img src="https://mc.yandex.ru/watch/98897513" style="position:absolute; left:-9999px;" alt="" /></div></noscript> |
367 | 377 | <!-- /Yandex.Metrika counter --> |
368 | - | |
369 | 378 | @endif |
370 | 379 | </body> |
371 | 380 | </html> |