kopia lustrzana https://github.com/bugout-dev/moonstream
time to convert to user
rodzic
5896c04051
commit
e2a0822f79
|
@ -8,7 +8,7 @@ import UIContext from "../UIProvider/context";
|
|||
const AnalyticsProvider = ({ children }) => {
|
||||
const clientID = useClientID();
|
||||
const analytics = process.env.NEXT_PUBLIC_MIXPANEL_TOKEN;
|
||||
const { user } = useUser();
|
||||
const { user, isInit } = useUser();
|
||||
const [isMixpanelReady, setIsLoaded] = useState(false);
|
||||
const router = useRouter();
|
||||
|
||||
|
@ -19,6 +19,12 @@ const AnalyticsProvider = ({ children }) => {
|
|||
}
|
||||
}, [ui.isOnboardingComplete, isMixpanelReady, user]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!user && isInit && isMixpanelReady) {
|
||||
mixpanel.time_event(MIXPANEL_EVENTS.CONVERT_TO_USER);
|
||||
}
|
||||
}, [user, isInit, isMixpanelReady]);
|
||||
|
||||
useEffect(() => {
|
||||
if (ui.onboardingStep && isMixpanelReady) {
|
||||
mixpanel.people.set(MIXPANEL_EVENTS.ONBOARDING_STEPS, ui.onboardingStep);
|
||||
|
|
Ładowanie…
Reference in New Issue