analytics: add the Yandex.Metrika counter to all four landings
Counter 112352796 goes into the <head> of every landing's index.html, ahead of the Vite entry, so the hit fires before React mounts. The pages are plain SPAs served off disk by nginx (Express only answers /api/*), so the static head is the only place it needs to be. One counter serves all four domains, which means reports mix them and every domain has to be listed in the counter's own settings or its hits get filtered — noted in deploy/README.md along with the conversion tracking that is still missing: src/lib/lead.ts pushes a plain custom dataLayer event, which Metrika's ecommerce: 'dataLayer' does not read. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
9736024e60
commit
e7385e8898
@@ -36,6 +36,43 @@
|
||||
"url": "%VITE_SITE_URL%"
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- 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?id=112352796', 'ym')
|
||||
|
||||
ym(112352796, 'init', {
|
||||
ssr: true,
|
||||
webvisor: true,
|
||||
clickmap: true,
|
||||
ecommerce: 'dataLayer',
|
||||
referrer: document.referrer,
|
||||
url: location.href,
|
||||
accurateTrackBounce: true,
|
||||
trackLinks: true,
|
||||
})
|
||||
</script>
|
||||
<noscript
|
||||
><div><img src="https://mc.yandex.ru/watch/112352796" style="position: absolute; left: -9999px" alt="" /></div
|
||||
></noscript>
|
||||
<!-- /Yandex.Metrika counter -->
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
Reference in New Issue
Block a user