From 84967e5cdfaad934d1a816f70c6800cf2ce594ac Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Tue, 17 May 2022 21:52:57 +0530 Subject: [PATCH] Add login event (#2784) Co-authored-by: Bailey Pumfleet --- apps/web/lib/telemetry.ts | 1 + apps/web/pages/auth/login.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/web/lib/telemetry.ts b/apps/web/lib/telemetry.ts index df787e7f33..a54fdbbe35 100644 --- a/apps/web/lib/telemetry.ts +++ b/apps/web/lib/telemetry.ts @@ -11,6 +11,7 @@ export const telemetryEventTypes = { bookingCancelled: "booking_cancelled", importSubmitted: "import_submitted", googleLogin: "google_login", + login: "login", samlLogin: "saml_login", samlConfig: "saml_config", embedView: "embed_view", diff --git a/apps/web/pages/auth/login.tsx b/apps/web/pages/auth/login.tsx index b76c6499c6..0d7404fae8 100644 --- a/apps/web/pages/auth/login.tsx +++ b/apps/web/pages/auth/login.tsx @@ -105,6 +105,7 @@ export default function Login({ form={form} className="space-y-6" handleSubmit={(values) => { + telemetry.withJitsu((jitsu) => jitsu.track(telemetryEventTypes.login, collectPageParameters())); signIn<"credentials">("credentials", { ...values, callbackUrl, redirect: false }) .then((res) => { if (!res) setErrorMessage(errorMessages[ErrorCode.InternalServerError]);