feat(analytics): add Yandex.Metrika tracking script to base layout
Add Yandex.Metrika counter script to track user interactions and behavior
This commit is contained in:
@@ -36,6 +36,43 @@ const t = useTranslations(Astro.currentLocale)
|
|||||||
<link rel="canonical" href={Astro.url} />
|
<link rel="canonical" href={Astro.url} />
|
||||||
<title>{`${title} | ${t('seo.og.title')}`}</title>
|
<title>{`${title} | ${t('seo.og.title')}`}</title>
|
||||||
<ClientRouter />
|
<ClientRouter />
|
||||||
|
<!-- 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(103393267, 'init', {
|
||||||
|
clickmap: true,
|
||||||
|
trackLinks: true,
|
||||||
|
accurateTrackBounce: true,
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<noscript
|
||||||
|
><div>
|
||||||
|
<img
|
||||||
|
src="https://mc.yandex.ru/watch/103393267"
|
||||||
|
style="position:absolute; left:-9999px;"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
</div></noscript
|
||||||
|
>
|
||||||
|
<!-- /Yandex.Metrika counter -->
|
||||||
</head>
|
</head>
|
||||||
<body class={bodyClass}>
|
<body class={bodyClass}>
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
Reference in New Issue
Block a user