mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-02 18:51:52 +02:00
📈 Improvements to posthog analytics data (#1189)
This commit is contained in:
parent
278713d57f
commit
587e11de17
10 changed files with 93 additions and 80 deletions
|
@ -77,7 +77,7 @@ export const auth = router({
|
|||
locale: z.string().optional(),
|
||||
}),
|
||||
)
|
||||
.mutation(async ({ input }) => {
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
const payload = await decryptToken<RegistrationTokenPayload>(input.token);
|
||||
|
||||
if (!payload) {
|
||||
|
@ -99,6 +99,19 @@ export const auth = router({
|
|||
},
|
||||
});
|
||||
|
||||
ctx.posthogClient?.capture({
|
||||
event: "register",
|
||||
distinctId: user.id,
|
||||
properties: {
|
||||
$set: {
|
||||
email: user.email,
|
||||
name: user.name,
|
||||
timeZone: input.timeZone,
|
||||
locale: input.locale,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return { ok: true, user };
|
||||
}),
|
||||
getUserPermission: publicProcedure
|
||||
|
|
|
@ -923,13 +923,7 @@ export const polls = router({
|
|||
},
|
||||
});
|
||||
|
||||
waitUntil(
|
||||
Promise.all([
|
||||
emailToHost,
|
||||
...emailsToParticipants,
|
||||
ctx.posthogClient?.flushAsync(),
|
||||
]),
|
||||
);
|
||||
waitUntil(Promise.all([emailToHost, ...emailsToParticipants]));
|
||||
}
|
||||
}),
|
||||
reopen: possiblyPublicProcedure
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue