🐛 Correction du tracking Matomo
Les urls remontées n'étaient pas mises à jour lors de la navigationpull/1182/head
parent
1b57f679a1
commit
947cffbff4
|
@ -7,7 +7,12 @@ declare global {
|
|||
}
|
||||
}
|
||||
|
||||
type PushArgs = ['trackPageView'] | ['trackEvent', ...Array<string | number>]
|
||||
type MatomoAction =
|
||||
| 'trackPageView'
|
||||
| 'trackEvent'
|
||||
| 'setReferrerUrl'
|
||||
| 'setCustomUrl'
|
||||
type PushArgs = [MatomoAction, ...Array<string | number>]
|
||||
type PushType = (args: PushArgs) => void
|
||||
|
||||
const ua = window.navigator.userAgent
|
||||
|
@ -60,6 +65,12 @@ export default class Tracker {
|
|||
if (this.previousPath === currentPath) {
|
||||
return
|
||||
}
|
||||
if (this.previousPath) {
|
||||
this.push(['setReferrerUrl', this.previousPath])
|
||||
}
|
||||
this.push(['setCustomUrl', currentPath])
|
||||
// TODO: We should also call 'setDocumentTitle' but at this point the
|
||||
// document.title isn't updated yet.
|
||||
this.push(['trackPageView'])
|
||||
this.previousPath = currentPath
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue