diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx index 847de19165..9352f7c115 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx @@ -9,6 +9,7 @@ import type { Item } from '@/app/components/base/select' import { SimpleSelect } from '@/app/components/base/select' import { TIME_PERIOD_MAPPING } from '@/app/components/app/log/filter' import { useStore as useAppStore } from '@/app/components/app/store' +import { sendGAEvent } from '@/utils/gtag' dayjs.extend(quarterOfYear) @@ -56,6 +57,10 @@ export default function ChartView({ appId, headerRight }: IChartViewProps) { className='mt-0 !w-40' notClearable={true} onSelect={(item) => { + sendGAEvent(isWorkflow ? 'filter_workflow_overview_period' : 'filter_chat_conversation_overview_period', { + period: item.value, + period_name: item.name, + }) const id = item.value const value = TIME_PERIOD_MAPPING[id]?.value ?? '-1' const name = item.name || t('appLog.filter.period.allTime') diff --git a/web/app/components/app/log/filter.tsx b/web/app/components/app/log/filter.tsx index 6e259a2f19..affaa879b0 100644 --- a/web/app/components/app/log/filter.tsx +++ b/web/app/components/app/log/filter.tsx @@ -11,6 +11,7 @@ import Chip from '@/app/components/base/chip' import Input from '@/app/components/base/input' import Sort from '@/app/components/base/sort' import { fetchAnnotationsCount } from '@/service/log' +import { sendGAEvent } from '@/utils/gtag' dayjs.extend(quarterOfYear) const today = dayjs() @@ -47,6 +48,10 @@ const Filter: FC = ({ isChatMode, appId, queryParams, setQueryPara leftIcon={} value={queryParams.period} onSelect={(item) => { + sendGAEvent('filter_chat_conversation_period', { + period: item.value, + period_name: item.name, + }) setQueryParams({ ...queryParams, period: item.value }) }} onClear={() => setQueryParams({ ...queryParams, period: '9' })} @@ -58,6 +63,10 @@ const Filter: FC = ({ isChatMode, appId, queryParams, setQueryPara showLeftIcon={false} value={queryParams.annotation_status || 'all'} onSelect={(item) => { + sendGAEvent('filter_chat_conversation_annotation_status', { + annotation_status: item.value, + annotation_status_name: item.name, + }) setQueryParams({ ...queryParams, annotation_status: item.value as string }) }} onClear={() => setQueryParams({ ...queryParams, annotation_status: 'all' })} diff --git a/web/app/components/app/workflow-log/filter.tsx b/web/app/components/app/workflow-log/filter.tsx index c75c058c68..7f8536b22b 100644 --- a/web/app/components/app/workflow-log/filter.tsx +++ b/web/app/components/app/workflow-log/filter.tsx @@ -57,6 +57,10 @@ const Filter: FC = ({ queryParams, setQueryParams }: IFilterProps) leftIcon={} value={queryParams.period} onSelect={(item) => { + sendGAEvent('filter_workflow_period', { + period: item.value, + period_name: item.name, + }) setQueryParams({ ...queryParams, period: item.value }) }} onClear={() => setQueryParams({ ...queryParams, period: '9' })}