You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even if the confirm_tracking cookie has not been set, on initial load of the dsgvo add'on, a unique Matomo _pk_id cookie is set. The pageview tracking does not occur, but addblockers like ghostery are already responding on the setCookie (we got a complaint from a visitor on the client project using volto-dsgvo-banner.
I think the problem in here, where the tracker is always initialised and immediately sets the cookie. But I'm a bit wary with my state management/hooks knowledge in React, would it be safe here to move the tracker initialiasation in the useEffect? Or will that mess up the state as the tracker object is also in the useEffect variables array.
The matomo-tracker-js readme mentions a separate subkey 'configurations' where you can disable setting cookies. But as soon as a visitor does give consent, you'd want to enable it again. Maybe it is enough to add disableCookes as an option to the tracker initialisation as long as consent hasn't been given.
@sneridagh@danalvrz So the issue with the current Matomo integration in volto-dsgvo-banner is that the tracker object that is created in the Matomo.jsx component with the code outlined above, by default sets a _pk_id client. By adding
configurations: { // optional, default value: {}
// any valid matomo configuration, all below are optional
disableCookies: true,
}
as an extra subkey to the new matomoTracker.default({}) call, I think this could be prevented. But I wonder if I end up in React StateHelll.
Becaue I would need to change/recreate the matomoTracker object with 'disableCookies: false' as soon as confirmTracking becomes True. And the reverse if consent is withdrawn for tracking. and the tracking object is part of the useEffect array. How can I set this us correctly without hurting my brain?
I suspect this is an issue in the datapunt/matomo-tracker.js library or how we call the tracker module in the addon:
volto-dsgvo-banner/package.json
Line 81 in d15ce58
Even if the confirm_tracking cookie has not been set, on initial load of the dsgvo add'on, a unique Matomo _pk_id cookie is set. The pageview tracking does not occur, but addblockers like ghostery are already responding on the setCookie (we got a complaint from a visitor on the client project using volto-dsgvo-banner.
I think the problem in here, where the tracker is always initialised and immediately sets the cookie. But I'm a bit wary with my state management/hooks knowledge in React, would it be safe here to move the tracker initialiasation in the useEffect? Or will that mess up the state as the tracker object is also in the useEffect variables array.
volto-dsgvo-banner/src/components/Banner/Matomo.jsx
Lines 6 to 22 in d15ce58
The matomo-tracker-js readme mentions a separate subkey 'configurations' where you can disable setting cookies. But as soon as a visitor does give consent, you'd want to enable it again. Maybe it is enough to add disableCookes as an option to the tracker initialisation as long as consent hasn't been given.
https://www.npmjs.com/package/@datapunt/matomo-tracker-js
The text was updated successfully, but these errors were encountered: