-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Filing this issue also on behalf of @ericof because I chatted with him about this.
We've been trying to run some campaigns on the plone.org website, where we link from a twitter/mastodon post to an article on plone.org with url parameters. A link for example would be like this:
https://plone.org/news-and-events/news/2023/plone-6-0-6-released?mtm_campaign=releases&mtm_medium=social
The idea is that matomo picks up the url parameters and counts one hit to the releases campaign for the social media medium. However: Matomo never records this 'hit' . We suspect that volto-matomo in the AppExtra component that gets configured only pushes the href but strips of any url params here:
volto-matomo/src/MatomoAppExtra.jsx
Lines 12 to 25 in 4a62439
React.useEffect(() => { | |
if (href === pathname) { | |
// a document (content) | |
trackPageView({ href, documentTitle: title }); | |
} | |
if (baseUrl !== pathname) { | |
// a route (utility view) | |
const action = pathname.split('/')[pathname.split('/').length - 1]; | |
trackPageView({ href: pathname, documentTitle: action }); | |
} | |
}, [href, pathname, title, baseUrl]); | |
return <React.Fragment />; | |
}; |