mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 14:45:53 +08:00
feat: add account creation page events (#3619)
This commit is contained in:
parent
e24918044e
commit
a8f8580606
@ -17,6 +17,7 @@ import { useLocation } from 'react-router-dom';
|
|||||||
import { SuccessResponse } from 'types/api';
|
import { SuccessResponse } from 'types/api';
|
||||||
import { PayloadProps } from 'types/api/user/getUser';
|
import { PayloadProps } from 'types/api/user/getUser';
|
||||||
import { PayloadProps as LoginPrecheckPayloadProps } from 'types/api/user/loginPrecheck';
|
import { PayloadProps as LoginPrecheckPayloadProps } from 'types/api/user/loginPrecheck';
|
||||||
|
import { trackEvent } from 'utils/segmentAnalytics';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ButtonContainer,
|
ButtonContainer,
|
||||||
@ -84,6 +85,13 @@ function SignUp({ version }: SignUpProps): JSX.Element {
|
|||||||
form.setFieldValue('email', responseDetails.email);
|
form.setFieldValue('email', responseDetails.email);
|
||||||
form.setFieldValue('organizationName', responseDetails.organization);
|
form.setFieldValue('organizationName', responseDetails.organization);
|
||||||
setIsDetailsDisable(true);
|
setIsDetailsDisable(true);
|
||||||
|
|
||||||
|
trackEvent('Account Creation Page Visited', {
|
||||||
|
email: responseDetails.email,
|
||||||
|
name: responseDetails.name,
|
||||||
|
company_name: responseDetails.organization,
|
||||||
|
source: 'SigNoz Cloud',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
getInviteDetailsResponse.data?.payload,
|
getInviteDetailsResponse.data?.payload,
|
||||||
@ -230,6 +238,10 @@ function SignUp({ version }: SignUpProps): JSX.Element {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
if (!isPasswordValid(values.password)) {
|
if (!isPasswordValid(values.password)) {
|
||||||
|
trackEvent('Account Creation Page - Invalid Password', {
|
||||||
|
email: values.email,
|
||||||
|
name: values.firstName,
|
||||||
|
});
|
||||||
setIsPasswordPolicyError(true);
|
setIsPasswordPolicyError(true);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return;
|
return;
|
||||||
@ -238,6 +250,11 @@ function SignUp({ version }: SignUpProps): JSX.Element {
|
|||||||
if (isPreferenceVisible) {
|
if (isPreferenceVisible) {
|
||||||
await commonHandler(values, onAdminAfterLogin);
|
await commonHandler(values, onAdminAfterLogin);
|
||||||
} else {
|
} else {
|
||||||
|
trackEvent('Account Created Successfully', {
|
||||||
|
email: values.email,
|
||||||
|
name: values.firstName,
|
||||||
|
});
|
||||||
|
|
||||||
await commonHandler(
|
await commonHandler(
|
||||||
values,
|
values,
|
||||||
async (): Promise<void> => {
|
async (): Promise<void> => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user