feat: Enhance Amplitude tracking across various components (#29662)

Co-authored-by: CodingOnStar <hanxujiang@dify.ai>
This commit is contained in:
Coding On Star
2025-12-15 15:25:10 +08:00
committed by GitHub
parent 724cd57dbf
commit d942adf3b2
15 changed files with 96 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ import Button from '@/app/components/base/button'
import { ToastContext } from '@/app/components/base/toast'
import { createEmptyDataset } from '@/service/datasets'
import { useInvalidDatasetList } from '@/service/knowledge/use-dataset'
import { trackEvent } from '@/app/components/base/amplitude'
type IProps = {
show: boolean
@@ -40,6 +41,10 @@ const EmptyDatasetCreationModal = ({
try {
const dataset = await createEmptyDataset({ name: inputValue })
invalidDatasetList()
trackEvent('create_empty_datasets', {
name: inputValue,
dataset_id: dataset.id,
})
onHide()
router.push(`/datasets/${dataset.id}/documents`)
}

View File

@@ -64,6 +64,7 @@ import { noop } from 'lodash-es'
import { useDocLink } from '@/context/i18n'
import { useInvalidDatasetList } from '@/service/knowledge/use-dataset'
import { checkShowMultiModalTip } from '../../settings/utils'
import { trackEvent } from '@/app/components/base/amplitude'
const TextLabel: FC<PropsWithChildren> = (props) => {
return <label className='system-sm-semibold text-text-secondary'>{props.children}</label>
@@ -568,6 +569,10 @@ const StepTwo = ({
if (mutateDatasetRes)
mutateDatasetRes()
invalidDatasetList()
trackEvent('create_datasets', {
data_source_type: dataSourceType,
indexing_technique: getIndexing_technique(),
})
onStepChange?.(+1)
if (isSetting)
onSave?.()