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
{{ message }}
This repository was archived by the owner on Jan 30, 2023. It is now read-only.
I have a React frontend where users have to log in. The tracking instance is created one the user is logged in with userId corresponding to user's first name and last name.
When user A logs out then user B logs in, Matomo backend still track events for user A
Describe the solution you'd like
How to programatically refresh or reset the Matomo Instance / Context?
Additional context
This is my Matomo tracker Provider:
exportconstTrackingWrapper=({ children }: {children: React.ReactNode})=>{const[{ firstName, lastName }]=useContext(UserContext);consttrackerInstance=useMemo(()=>createInstance({urlBase: MATOMO_TRACKER_URL,userId: `${firstName}${lastName}`,// Will change on different user log out / log insiteId: 1,linkTracking: false,configurations: {disableCookies: true,},}),[firstName,lastName]);return<MatomoProvidervalue={trackerInstance}>{children}</MatomoProvider>;};
I have a React frontend where users have to log in. The tracking instance is created one the user is logged in with
userIdcorresponding to user's first name and last name.When user A logs out then user B logs in, Matomo backend still track events for user A
Describe the solution you'd like
How to programatically refresh or reset the Matomo Instance / Context?
Additional context
This is my Matomo tracker Provider: