The tracker starts sending data, but I am facing an issue where it only records visits to the main page.
Questions:
How can I ensure that Yandex Tracker sends data for all pages in my ReactJS application, not just the main page?
Are there additional configurations or methods I need to implement for tracking page views in a single-page application (SPA)?
Any guidance or insights would be greatly appreciated.
I attempted to resolve this issue by writing a tracking function and implementing it in my App.tsx, but it did not yield the desired effect. Additionally, I tried adding it to the innerHTML through a function, but this approach also did not solve the problem. I apologize if I have expressed myself incorrectly, as I primarily focus on back-end development. However, our front-end team has been unable to find a solution, which has resulted in this task being assigned to me.
I attempted to resolve this issue by writing a tracking function and implementing it in my App.tsx, but it did not yield the desired effect. Additionally, I tried adding it to the innerHTML through a function, but this approach also did not solve the problem. I apologize if I have expressed myself incorrectly, as I primarily focus on back-end development. However, our front-end team has been unable to find a solution, which has resulted in this task being assigned to me.
<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(95474831, "init", {
clickmap: true,
trackLinks: true,
accurateTrackBounce: true,
webvisor: true,
ecommerce: "dataLayer"
});
</script>
<noscript>
<div><img src="https://mc.yandex.ru/watch/xxxxxxx" style="position:absolute; left:-9999px;" alt="" /></div>
</noscript>
You need to sign in to view this answers
Leave feedback about this