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

@@ -13,6 +13,7 @@ import { useTranslation } from 'react-i18next'
import useTheme from '@/hooks/use-theme'
import { Theme } from '@/types/app'
import { basePath } from '@/utils/var'
import { trackEvent } from '@/app/components/base/amplitude'
const normalizeProviderIcon = (icon?: ToolWithProvider['icon']) => {
if (!icon)
@@ -102,6 +103,10 @@ const ToolItem: FC<Props> = ({
params,
meta: provider.meta,
})
trackEvent('tool_selected', {
tool_name: payload.name,
plugin_id: provider.plugin_id,
})
}}
>
<div className={cn('system-sm-medium h-8 truncate border-l-2 border-divider-subtle pl-4 leading-8 text-text-secondary')}>