diff --git a/src/PosthogEvents.ts b/src/PosthogEvents.ts index 500d77d3..f1b4baef 100644 --- a/src/PosthogEvents.ts +++ b/src/PosthogEvents.ts @@ -121,13 +121,15 @@ export class LoginTracker { interface MuteMicrophone { eventName: "MuteMicrophone"; targetMuteState: "mute" | "unmute"; + callId: string; } export class MuteMicrophoneTracker { - track(targetIsMute: boolean) { + track(targetIsMute: boolean, callId: string) { PosthogAnalytics.instance.trackEvent({ eventName: "MuteMicrophone", targetMuteState: targetIsMute ? "mute" : "unmute", + callId, }); } } @@ -135,13 +137,15 @@ export class MuteMicrophoneTracker { interface MuteCamera { eventName: "MuteCamera"; targetMuteState: "mute" | "unmute"; + callId: string; } export class MuteCameraTracker { - track(targetIsMute: boolean) { + track(targetIsMute: boolean, callId: string) { PosthogAnalytics.instance.trackEvent({ eventName: "MuteCamera", targetMuteState: targetIsMute ? "mute" : "unmute", + callId, }); } } diff --git a/src/room/useGroupCall.ts b/src/room/useGroupCall.ts index 7921e42c..77ef38f6 100644 --- a/src/room/useGroupCall.ts +++ b/src/room/useGroupCall.ts @@ -359,13 +359,19 @@ export function useGroupCall(groupCall: GroupCall): UseGroupCallReturnType { const toggleLocalVideoMuted = useCallback(() => { const toggleToMute = !groupCall.isLocalVideoMuted(); groupCall.setLocalVideoMuted(toggleToMute); - PosthogAnalytics.instance.eventMuteCamera.track(toggleToMute); + PosthogAnalytics.instance.eventMuteCamera.track( + toggleToMute, + groupCall.groupCallId + ); }, [groupCall]); const setMicrophoneMuted = useCallback( (setMuted) => { groupCall.setMicrophoneMuted(setMuted); - PosthogAnalytics.instance.eventMuteMicrophone.track(setMuted); + PosthogAnalytics.instance.eventMuteMicrophone.track( + setMuted, + groupCall.groupCallId + ); }, [groupCall] );