mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-29 02:06:34 +02:00
📈 Switch to posthog alias for guest users
This commit is contained in:
parent
bb04eafdef
commit
2a9a2dec7d
1 changed files with 11 additions and 7 deletions
|
@ -54,13 +54,17 @@ export function PostHogProvider(props: PostHogProviderProps) {
|
|||
usePostHogPageView();
|
||||
|
||||
useMount(() => {
|
||||
posthog.identify(user.id, {
|
||||
email: user.email,
|
||||
name: user.name,
|
||||
tier: user.tier,
|
||||
timeZone: user.timeZone,
|
||||
locale: i18n.language,
|
||||
});
|
||||
if (user.email) {
|
||||
posthog.identify(user.id, {
|
||||
email: user.email,
|
||||
name: user.name,
|
||||
tier: user.tier,
|
||||
timeZone: user.timeZone,
|
||||
locale: i18n.language,
|
||||
});
|
||||
} else {
|
||||
posthog.alias(user.id);
|
||||
}
|
||||
});
|
||||
|
||||
return <Provider client={posthog}>{props.children}</Provider>;
|
||||
|
|
Loading…
Add table
Reference in a new issue