📈(frontend) add analytics on screen recording and transcript features
Use posthog to track whether user starts transcript or screen recording.
This commit is contained in:
committed by
aleb_the_flash
parent
fc1b4d7fa7
commit
f0742a0978
@@ -24,6 +24,7 @@ import {
|
|||||||
useNotifyParticipants,
|
useNotifyParticipants,
|
||||||
NotificationType,
|
NotificationType,
|
||||||
} from '@/features/notifications'
|
} from '@/features/notifications'
|
||||||
|
import posthog from 'posthog-js'
|
||||||
|
|
||||||
export const ScreenRecordingSidePanel = () => {
|
export const ScreenRecordingSidePanel = () => {
|
||||||
const [isLoading, setIsLoading] = useState(false)
|
const [isLoading, setIsLoading] = useState(false)
|
||||||
@@ -74,6 +75,7 @@ export const ScreenRecordingSidePanel = () => {
|
|||||||
await notifyParticipants({
|
await notifyParticipants({
|
||||||
type: NotificationType.ScreenRecordingStarted,
|
type: NotificationType.ScreenRecordingStarted,
|
||||||
})
|
})
|
||||||
|
posthog.capture('screen-recording-started', {})
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to handle transcript:', error)
|
console.error('Failed to handle transcript:', error)
|
||||||
@@ -124,7 +126,7 @@ export const ScreenRecordingSidePanel = () => {
|
|||||||
<Button
|
<Button
|
||||||
isDisabled={isDisabled}
|
isDisabled={isDisabled}
|
||||||
onPress={() => handleScreenRecording()}
|
onPress={() => handleScreenRecording()}
|
||||||
data-attr="stop-transcript"
|
data-attr="stop-screen-recording"
|
||||||
size="sm"
|
size="sm"
|
||||||
variant="tertiary"
|
variant="tertiary"
|
||||||
>
|
>
|
||||||
@@ -155,7 +157,7 @@ export const ScreenRecordingSidePanel = () => {
|
|||||||
<Button
|
<Button
|
||||||
isDisabled={isDisabled}
|
isDisabled={isDisabled}
|
||||||
onPress={() => handleScreenRecording()}
|
onPress={() => handleScreenRecording()}
|
||||||
data-attr="start-transcript"
|
data-attr="start-screen-recording"
|
||||||
size="sm"
|
size="sm"
|
||||||
variant="tertiary"
|
variant="tertiary"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import {
|
|||||||
useNotifyParticipants,
|
useNotifyParticipants,
|
||||||
NotificationType,
|
NotificationType,
|
||||||
} from '@/features/notifications'
|
} from '@/features/notifications'
|
||||||
|
import posthog from 'posthog-js'
|
||||||
|
|
||||||
export const TranscriptSidePanel = () => {
|
export const TranscriptSidePanel = () => {
|
||||||
const [isLoading, setIsLoading] = useState(false)
|
const [isLoading, setIsLoading] = useState(false)
|
||||||
@@ -77,6 +78,7 @@ export const TranscriptSidePanel = () => {
|
|||||||
await notifyParticipants({
|
await notifyParticipants({
|
||||||
type: NotificationType.TranscriptionStarted,
|
type: NotificationType.TranscriptionStarted,
|
||||||
})
|
})
|
||||||
|
posthog.capture('transcript-started', {})
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to handle transcript:', error)
|
console.error('Failed to handle transcript:', error)
|
||||||
|
|||||||
Reference in New Issue
Block a user