In this guide we tailor how to insert Yandex Metrica script in your anlyics for regular tracking and cookies policies purposes.
Add Yandex script for Tracking without Cookies policies:
Step 1: Find the Yandex counter ID
Log into your Yandex Metrica.
Search for the term “counter”. The counters appear in the search results.
Copy the counter ID. You’ll need it in the following steps.
Step 2: Insert the script in the Onboarding Online form
Get this script and isert your counter ID in the highlighted places:
<!-- 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();
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
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(YOUR counter ID, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true
});
window.yandexCounterId = YOUR counter ID;
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/YOUR counter ID" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
Open the Onboarding Online Analytics form and insert the script with YOUR metrica ID in the header, Click on Add Web Analytics:
Add Yandex analytics for Tracking with Cookies policies:
Step 1: Find the Yandex counter ID
Log into your Yandex Metrica.
Search for the term “counter”. The counters appear in the search results.
Copy the counter ID. You’ll need it in the following steps.
Step 2: Insert the Yandex counter ID in the Cookies check script
Click on 'Use Cookies Check'
The needed script will be added automatically:
Replace YOUR_YANDEX_METRICA_ID in all places in the script with your METRICA ID, that you have copied:
Click on Add Web Analtitycs
Don't forget to Update your Web Onboarding