diff --git a/web/app/components/app/create-app-dialog/app-list/index.tsx b/web/app/components/app/create-app-dialog/app-list/index.tsx index bef0292668..456f65d7c2 100644 --- a/web/app/components/app/create-app-dialog/app-list/index.tsx +++ b/web/app/components/app/create-app-dialog/app-list/index.tsx @@ -144,12 +144,12 @@ const Apps = ({ }) // Track app creation from template - trackEvent('app_created', { + trackEvent('create_app_with_template', { app_mode: mode, - creation_method: 'template', template_id: currApp?.app.id, template_name: currApp?.app.name, - has_description: !!description, + time: new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }), + has_description: description, }) setIsShowCreateModal(false) diff --git a/web/app/components/app/create-app-modal/index.tsx b/web/app/components/app/create-app-modal/index.tsx index 519b3469a5..8947c2fb37 100644 --- a/web/app/components/app/create-app-modal/index.tsx +++ b/web/app/components/app/create-app-modal/index.tsx @@ -85,10 +85,10 @@ function CreateApp({ onClose, onSuccess, onCreateFromTemplate, defaultAppMode }: }) // Track app creation success - trackEvent('app_created', { + trackEvent('create_app', { app_mode: appMode, - creation_method: 'blank', - has_description: !!description, + time: new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }), + description, }) notify({ type: 'success', message: t('app.newApp.appCreated') }) diff --git a/web/app/components/app/create-from-dsl-modal/index.tsx b/web/app/components/app/create-from-dsl-modal/index.tsx index 2af91d388d..3564738dfd 100644 --- a/web/app/components/app/create-from-dsl-modal/index.tsx +++ b/web/app/components/app/create-from-dsl-modal/index.tsx @@ -114,7 +114,7 @@ const CreateFromDSLModal = ({ show, onSuccess, onClose, activeTab = CreateFromDS const { id, status, app_id, app_mode, imported_dsl_version, current_dsl_version } = response if (status === DSLImportStatus.COMPLETED || status === DSLImportStatus.COMPLETED_WITH_WARNINGS) { // Track app creation from DSL import - trackEvent('app_created', { + trackEvent('create_app_with_dsl', { app_mode, creation_method: currentTab === CreateFromDSLModalTab.FROM_FILE ? 'dsl_file' : 'dsl_url', has_warnings: status === DSLImportStatus.COMPLETED_WITH_WARNINGS, diff --git a/web/app/components/app/workflow-log/filter.tsx b/web/app/components/app/workflow-log/filter.tsx index c792bb8a48..1ef1bd7a29 100644 --- a/web/app/components/app/workflow-log/filter.tsx +++ b/web/app/components/app/workflow-log/filter.tsx @@ -8,7 +8,6 @@ import quarterOfYear from 'dayjs/plugin/quarterOfYear' import type { QueryParam } from './index' import Chip from '@/app/components/base/chip' import Input from '@/app/components/base/input' -import { trackEvent } from '../../base/amplitude/utils' dayjs.extend(quarterOfYear) const today = dayjs() @@ -38,9 +37,6 @@ const Filter: FC = ({ queryParams, setQueryParams }: IFilterProps) value={queryParams.status || 'all'} onSelect={(item) => { setQueryParams({ ...queryParams, status: item.value as string }) - trackEvent('workflow_log_filter_status_selected', { - workflow_log_filter_status: item.value as string, - }) }} onClear={() => setQueryParams({ ...queryParams, status: 'all' })} items={[{ value: 'all', name: 'All' }, diff --git a/web/app/components/base/amplitude/AmplitudeProvider.tsx b/web/app/components/base/amplitude/AmplitudeProvider.tsx index 1a2e779117..8883da6411 100644 --- a/web/app/components/base/amplitude/AmplitudeProvider.tsx +++ b/web/app/components/base/amplitude/AmplitudeProvider.tsx @@ -27,7 +27,7 @@ const AmplitudeProvider: FC = ({ fileDownloads: true, }, // Enable debug logs in development environment - logLevel: process.env.NODE_ENV === 'development' ? amplitude.Types.LogLevel.Debug : amplitude.Types.LogLevel.Warn, + logLevel: amplitude.Types.LogLevel.Warn, }) // Log initialization success in development diff --git a/web/app/install/installForm.tsx b/web/app/install/installForm.tsx index 44c8560b3c..01bfd59b6d 100644 --- a/web/app/install/installForm.tsx +++ b/web/app/install/installForm.tsx @@ -19,7 +19,6 @@ import type { InitValidateStatusResponse, SetupStatusResponse } from '@/models/c import useDocumentTitle from '@/hooks/use-document-title' import { useDocLink } from '@/context/i18n' import { validPassword } from '@/config' -import { trackEvent } from '@/app/components/base/amplitude' const accountFormSchema = z.object({ email: z @@ -74,15 +73,6 @@ const InstallForm = () => { // Store tokens and redirect to apps if login successful if (loginRes.result === 'success') { - // Track initial setup completion - trackEvent('user_registration_success', { - method: 'initial_setup', - }) - trackEvent('user_login_success', { - method: 'initial_setup', - is_invite: false, - }) - router.replace('/apps') } else { diff --git a/web/app/signin/check-code/page.tsx b/web/app/signin/check-code/page.tsx index 4af2bdd1cc..7055eabc75 100644 --- a/web/app/signin/check-code/page.tsx +++ b/web/app/signin/check-code/page.tsx @@ -48,6 +48,7 @@ export default function CheckCode() { // Track login success event trackEvent('user_login_success', { method: 'email_code', + time: new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }), is_invite: !!invite_token, }) diff --git a/web/app/signin/components/mail-and-password-auth.tsx b/web/app/signin/components/mail-and-password-auth.tsx index ba37087719..f6fb8e3664 100644 --- a/web/app/signin/components/mail-and-password-auth.tsx +++ b/web/app/signin/components/mail-and-password-auth.tsx @@ -67,6 +67,7 @@ export default function MailAndPasswordAuth({ isInvite, isEmailSetup, allowRegis // Track login success event trackEvent('user_login_success', { method: 'email_password', + time: new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }), is_invite: isInvite, }) diff --git a/web/app/signup/check-code/page.tsx b/web/app/signup/check-code/page.tsx index 540af74872..35c5e78a45 100644 --- a/web/app/signup/check-code/page.tsx +++ b/web/app/signup/check-code/page.tsx @@ -42,7 +42,6 @@ export default function CheckCode() { } setIsLoading(true) const res = await verifyCode({ email, code, token }) - console.log(res) if ((res as MailValidityResponse).is_valid) { const params = new URLSearchParams(searchParams) params.set('token', encodeURIComponent((res as MailValidityResponse).token)) diff --git a/web/app/signup/set-password/page.tsx b/web/app/signup/set-password/page.tsx index 1e176b8d2f..71b59d3e7c 100644 --- a/web/app/signup/set-password/page.tsx +++ b/web/app/signup/set-password/page.tsx @@ -58,6 +58,7 @@ const ChangePasswordForm = () => { // Track registration success event trackEvent('user_registration_success', { method: 'email', + time: new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }), }) Toast.notify({