P
P
partyzanx2020-03-03 18:07:37
HTML
partyzanx, 2020-03-03 18:07:37

How to embed in pug js?

It is necessary to insert the Yandex counter code into PUG.

<!-- Yandex.Metrika counter -->
<script type="text/javascript" >
   (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://cdn.jsdelivr.net/npm/yandex-metrica-watch/tag.js", "ym");

   ym(123, "init", {
        clickmap:true,
        trackLinks:true,
        accurateTrackBounce:true,
        webvisor:true
   });
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/123" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->


I tried to output the script separately and translate it into pug format, but it still gives an error.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arseniy, 2020-03-03
@partyzanx

We read the dock , enjoy life.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question