Skip to content

Commit d49268f

Browse files
committed
fix: strip query params/hashes form matomo events
1 parent 7ee1347 commit d49268f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib/utils/matomo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export const trackCustomEvent = ({
2020
const isOptedOut = JSON.parse(optedOutValue)
2121
if (isOptedOut) return
2222

23+
// Set custom URL removing any query params or hash fragments
24+
window && push([`setCustomUrl`, window.location.href.replace(/[?#].*$/, "")])
2325
push([`trackEvent`, eventCategory, eventAction, eventName, eventValue])
2426

2527
console.debug(

0 commit comments

Comments
 (0)