How to include tracking code from Yandex.Metrica?

Hello,

First, I found this thread where it seems everything worked for a man:

And I do use Google Analytics extension. But I can’t figure out how to add code snippets to it because I use it with the ID: I just put an ID in the extension, not the code snippets.

So for Yandex.Metrica, I have these 2 snippets:

<!-- 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://mc.yandex.ru/metrika/tag.js", "ym");

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

Can you give me a hint on how I am to include it in X, via this extension or a child theme or anything?

Thank you!


Alex

Hey Alex,

For extra codes you need to add in the head and footer, you need to follow this guide https://kinsta.com/knowledgebase/add-code-wordpress-header-footer/

That will teach you how to inject code to the head and/or footer in WordPress.

Please just note that we do not provide support for custom codes and 3rd party plugins. In case your codes won’t work, please consult with a developer.

Hope that helps.

Hello Christian,

Thank you!


Alex

Hi Alex,

You are welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.