mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Record when the word count modal is opened (#29134)
GitOrigin-RevId: d49778199e793297c49447f56060dedb31750c34
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user