diff --git a/backend/src/controllers/v3/signupController.ts b/backend/src/controllers/v3/signupController.ts index cd9efdb0e..1f4a420dd 100644 --- a/backend/src/controllers/v3/signupController.ts +++ b/backend/src/controllers/v3/signupController.ts @@ -11,6 +11,7 @@ import { INVITED, ACCEPTED } from '../../variables'; import { standardRequest } from '../../config/request'; import { getLoopsApiKey, getHttpsEnabled, getJwtSignupSecret } from '../../config'; import { BadRequestError } from '../../utils/errors'; +import { TelemetryService } from '../../services'; /** * Complete setting up user by adding their personal and auth information as part of the @@ -37,6 +38,7 @@ export const completeAccountSignup = async (req: Request, res: Response) => { verifier, organizationName, providerAuthToken, + attributionSource, }: { email: string; firstName: string; @@ -52,6 +54,7 @@ export const completeAccountSignup = async (req: Request, res: Response) => { verifier: string; organizationName: string; providerAuthToken?: string; + attributionSource?: string; } = req.body; user = await User.findOne({ email }); @@ -161,6 +164,18 @@ export const completeAccountSignup = async (req: Request, res: Response) => { sameSite: 'strict', secure: await getHttpsEnabled() }); + + const postHogClient = await TelemetryService.getPostHogClient(); + if (postHogClient) { + postHogClient.capture({ + event: 'User Signed Up', + distinctId: req.user.email, + properties: { + email, + attributionSource + } + }); + } } catch (err) { Sentry.setUser(null); Sentry.captureException(err); diff --git a/frontend/src/components/login/InitialLoginStep.tsx b/frontend/src/components/login/InitialLoginStep.tsx index 973392f64..79b10bbde 100644 --- a/frontend/src/components/login/InitialLoginStep.tsx +++ b/frontend/src/components/login/InitialLoginStep.tsx @@ -1,8 +1,9 @@ import { useTranslation } from 'react-i18next'; import Link from 'next/link'; -import { faGoogle } from '@fortawesome/free-brands-svg-icons'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { useRouter } from 'next/router'; +// import { faGoogle } from '@fortawesome/free-brands-svg-icons'; +// import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Button } from '../v2'; export default function InitialLoginStep({ @@ -11,11 +12,12 @@ export default function InitialLoginStep({ setIsLoginWithEmail: (value: boolean) => void; }) { + const router = useRouter(); const { t } = useTranslation(); return
{t('signup.step5-subtitle')}
-