Skip to content

Commit

Permalink
chore: remove trailing / in tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
desoindx committed Dec 23, 2024
1 parent 60c1228 commit 7d2791e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils/matomo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ export const track = (category: string, action: string, name: string, ignoreRefe
}

if (!ignoreReferrer && url && !url.startsWith('https://impactco2.fr')) {
window.please.track(['trackEvent', `${category}_${url}`, action, name])
window.please.track([
'trackEvent',
`${category}_${url.endsWith('/') ? url.slice(0, url.length - 1) : url}`,
action,
name,
])
} else {
window.please.track(['trackEvent', category, action, name])
}
Expand Down

0 comments on commit 7d2791e

Please sign in to comment.