Commit fd5c469e authored by tom's avatar tom Committed by tom goriunov

[skip ci] reset mixpanel on logout

parent 10b4b96a
import getPageType from './getPageType'; import getPageType from './getPageType';
import getUuid from './getUuid'; import getUuid from './getUuid';
import logEvent from './logEvent'; import logEvent from './logEvent';
import reset from './reset';
import useInit from './useInit'; import useInit from './useInit';
import useLogPageView from './useLogPageView'; import useLogPageView from './useLogPageView';
import * as userProfile from './userProfile'; import * as userProfile from './userProfile';
...@@ -13,4 +14,5 @@ export { ...@@ -13,4 +14,5 @@ export {
getPageType, getPageType,
getUuid, getUuid,
userProfile, userProfile,
reset,
}; };
import mixpanel from 'mixpanel-browser';
import config from 'configs/app';
export default function reset() {
if (!config.features.mixpanel.isEnabled) {
return;
}
mixpanel.reset();
}
...@@ -53,6 +53,7 @@ export default function useLogout() { ...@@ -53,6 +53,7 @@ export default function useLogout() {
}); });
mixpanel.logEvent(mixpanel.EventTypes.ACCOUNT_ACCESS, { Action: 'Logged out' }, { send_immediately: true }); mixpanel.logEvent(mixpanel.EventTypes.ACCOUNT_ACCESS, { Action: 'Logged out' }, { send_immediately: true });
mixpanel.reset();
if ( if (
PROTECTED_ROUTES.includes(router.pathname) || PROTECTED_ROUTES.includes(router.pathname) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment