feat: Use yaMetrika number in settings

This commit is contained in:
2025-12-01 19:44:14 +03:00
parent c670e38392
commit cedc49f0d5
5 changed files with 54 additions and 46 deletions

View File

@@ -17,11 +17,11 @@ export function injectYaMetrika() {
script.src = '/index.php?route=extension/tgshop/handle/ya_metrika';
// script.async = true;
document.head.appendChild(script);
console.debug('[Init] Yandex Metrika injected to the page.');
console.debug('[ym] Yandex Metrika injected to the page.');
script.onload = () => {
window.YA_METRIKA_ID = getMetrikaId();
console.debug('[Init] Detected Yandex.Metrika ID:', window.YA_METRIKA_ID);
console.debug('[ym] Detected Yandex.Metrika ID:', window.YA_METRIKA_ID);
const yaMetrika = useYaMetrikaStore();
yaMetrika.initUserParams();
window.dataLayer = window.dataLayer || [];