Skip to content

Commit

Permalink
SetCustomUrl serait nécessaire d'après SocialGouv/matomo-next#99 (com…
Browse files Browse the repository at this point in the history
  • Loading branch information
laem committed Mar 27, 2024
1 parent e81e70f commit 44a36d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/Matomo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const MatomoComponent = () => {
const searchParamsString = searchParams.toString()
useEffect(() => {
if (!pathname) return
// may be necessary to decodeURIComponent searchParamsString ?
const url = pathname + (searchParamsString ? '?' + searchParamsString : '')
push(['setCustomUrl', url])
push(['trackPageView'])
}, [pathname, searchParamsString])
return null
Expand Down

0 comments on commit 44a36d4

Please sign in to comment.