Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matomo tracker is only triggered for initial SSR page load #37

Open
davisagli opened this issue Dec 9, 2024 · 1 comment
Open

Matomo tracker is only triggered for initial SSR page load #37

davisagli opened this issue Dec 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@davisagli
Copy link
Member

If tracking is enabled, it appears that it only tracks a page view for the initial SSR page load, and not for further navigation via the Volto router. @sneridagh Is that intentional? Because it's surprising.

This is because the Matomo component only calls trackPageView when the component is first mounted (via useEffect). It needs the location/path as a dependency for that useEffect in order to track subsequent navigation.

@davisagli davisagli added the bug Something isn't working label Dec 9, 2024
@fredvd
Copy link

fredvd commented Dec 11, 2024

@davisagli as I mentionned yesterday, volto-matomo is another implementation that we're using on plone.org. It does have the dependency on path/location as you describe i its code:

https://github.com/eea/volto-matomo/blob/master/src/MatomoAppExtra.jsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants