diff --git a/detection/start.ts b/detection/start.ts index 1057be57f..c70f00b88 100644 --- a/detection/start.ts +++ b/detection/start.ts @@ -59,6 +59,8 @@ const transformText = (element: Element, language: 'fr' | 'en', darkMode?: boole }) } export const initMatomo = () => { + //@ts-expect-error: Matomo redefinition + const paqInit = window._paq //@ts-expect-error: Matomo redefinition const _paq_impactco2 = (window._paq_impactco2 = window._paq_impactco2 || []) ;(function () { @@ -73,6 +75,12 @@ export const initMatomo = () => { g.type = 'text/javascript' g.async = true g.src = u + '/matomo.js' + g.onload = function () { + //@ts-expect-error: Matomo redefinition + window._paq_impactco2 = window._paq + //@ts-expect-error: Matomo redefinition + window._paq = paqInit + } //@ts-expect-error: Matomo redefinition s.parentNode.insertBefore(g, s) })()