diff --git a/services/web/frontend/js/features/word-count-modal/components/word-count-modal-content.tsx b/services/web/frontend/js/features/word-count-modal/components/word-count-modal-content.tsx index fda2aa21a0..ba38b4e64f 100644 --- a/services/web/frontend/js/features/word-count-modal/components/word-count-modal-content.tsx +++ b/services/web/frontend/js/features/word-count-modal/components/word-count-modal-content.tsx @@ -10,6 +10,8 @@ import { WordCountServer } from './word-count-server' import { WordCountClient } from './word-count-client' import { isSplitTestEnabled } from '@/utils/splitTestUtils' import SplitTestBadge from '@/shared/components/split-test-badge' +import { useEffect } from 'react' +import { useEditorAnalytics } from '@/shared/hooks/use-editor-analytics' // NOTE: this component is only mounted when the modal is open export default function WordCountModalContent({ @@ -19,6 +21,15 @@ export default function WordCountModalContent({ }) { const { t } = useTranslation() + const { sendEvent } = useEditorAnalytics() + + useEffect(() => { + // record when the word count modal is opened + sendEvent('word-count-opened', { + mode: isSplitTestEnabled('word-count-client') ? 'client' : 'server', + }) + }, [sendEvent]) + return ( <>