Skip to content

Commit

Permalink
fix: matomo on detector
Browse files Browse the repository at this point in the history
  • Loading branch information
desoindx committed Nov 24, 2024
1 parent bf3eac8 commit 5ca8277
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions detection/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand All @@ -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)
})()
Expand Down

0 comments on commit 5ca8277

Please sign in to comment.