From f68ac382ccbc8f09602763debf1f5c4c1565f3cf Mon Sep 17 00:00:00 2001 From: Sreejith <1743700+ppsreejith@users.noreply.github.com> Date: Sun, 10 Nov 2024 07:50:36 -0800 Subject: [PATCH] Rename discoveryMethod to discoverySource --- web/src/components/common/Auth.tsx | 18 +++++++++--------- web/src/tracking/index.ts | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/web/src/components/common/Auth.tsx b/web/src/components/common/Auth.tsx index a87b0e5..bfd330e 100644 --- a/web/src/components/common/Auth.tsx +++ b/web/src/components/common/Auth.tsx @@ -124,7 +124,7 @@ function shuffle(array: Array) { } -const defaultDiscoveryMethods = [ +const defaultDiscoverySources = [ { label: "Instagram", value: "Instagram", @@ -151,7 +151,7 @@ const defaultDiscoveryMethods = [ }, ] -shuffle(defaultDiscoveryMethods) +shuffle(defaultDiscoverySources) const Auth = () => { @@ -160,7 +160,7 @@ const Auth = () => { const [authJWT, setAuthJWT] = useState(""); const [isFirstTimeUser, setIsFirstTimeUser] = useState(false); const [otp, setOTP] = useState(""); - const [discoveryMethod, setDiscoveryMethod] = useState(""); + const [discoverySource, setDiscoverySource] = useState(""); const isOTPMode = authJWT ? true : false const handleVerifyOtp = () => { if (!otp) { @@ -173,7 +173,7 @@ const Auth = () => { position: 'bottom-right', }) } - if (isFirstTimeUser && !discoveryMethod) { + if (isFirstTimeUser && !discoverySource) { return toast({ title: 'Please fill all the fields', description: "Please tell us how you found us!", @@ -183,8 +183,8 @@ const Auth = () => { position: 'bottom-right', }) } - if (discoveryMethod) { - captureEvent(GLOBAL_EVENTS.user_discovery_method, { email, discoveryMethod }) + if (discoverySource) { + captureEvent(GLOBAL_EVENTS.user_discovery_source, { email, discoverySource }) } console.log('Login params are', authJWT, otp, session_jwt) captureEvent(GLOBAL_EVENTS.otp_attempted, { email, otp, authJWT }) @@ -195,7 +195,7 @@ const Auth = () => { email, })) if (is_new_user) { - captureEvent(GLOBAL_EVENTS.user_signup, { email, profile_id, discoveryMethod }) + captureEvent(GLOBAL_EVENTS.user_signup, { email, profile_id, discoverySource }) } else { captureEvent(GLOBAL_EVENTS.user_login, { email, profile_id }) } @@ -313,8 +313,8 @@ const Auth = () => { chakraStyles={{container: (base) => ({...base, width: "100%"})}} tagColorScheme="purple" placeholder="How did you find us?" - onChange={(option) => setDiscoveryMethod(get(option, 'value', ''))} - options={defaultDiscoveryMethods} + onChange={(option) => setDiscoverySource(get(option, 'value', ''))} + options={defaultDiscoverySources} /> : null } diff --git a/web/src/tracking/index.ts b/web/src/tracking/index.ts index b53b8ee..d50250e 100644 --- a/web/src/tracking/index.ts +++ b/web/src/tracking/index.ts @@ -10,7 +10,7 @@ export const GLOBAL_EVENTS = { "otp_failed": "global/otp_failed", "otp_success": "global/otp_success", "user_signup": "global/user_signup", - "user_discovery_method": "global/user_discovery_method", + "user_discovery_source": "global/user_discovery_source", "user_login": "global/user_login", "billing_checkout": "global/billing_checkout", "billing_portal": "global/billing_portal",