Record when the word count modal is opened (#29134)

GitOrigin-RevId: d49778199e793297c49447f56060dedb31750c34
This commit is contained in:
Alf Eaton
2025-11-03 10:50:40 +00:00
committed by Copybot
parent 632f7c85ed
commit ad3d68ece0

View File

@@ -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 (
<>
<OLModalHeader>