@@ -210,6 +210,10 @@ interface ISendMessageEvent extends IEvent {
210210
211211interface IRoomDirectoryEvent extends IEvent {
212212 key : "room_directory" ;
213+ }
214+
215+ interface IRoomDirectoryDoneEvent extends IEvent {
216+ key : "room_directory_done" ;
213217 dur : number ; // time spent in the room directory modal
214218}
215219
@@ -666,8 +670,8 @@ export default class CountlyAnalytics {
666670 private queue ( args : Omit < IEvent , "timestamp" | "hour" | "dow" | "count" > & Partial < Pick < IEvent , "count" > > ) {
667671 const { count = 1 , ...rest } = args ;
668672 const ev = {
669- ...rest ,
670673 ...this . getTimeParams ( ) ,
674+ ...rest ,
671675 count,
672676 platform : this . appPlatform ,
673677 app_version : this . appVersion ,
@@ -913,8 +917,12 @@ export default class CountlyAnalytics {
913917 } , roomId ) ;
914918 }
915919
920+ public trackRoomDirectoryBegin ( ) {
921+ this . track < IRoomDirectoryEvent > ( "room_directory" ) ;
922+ }
923+
916924 public trackRoomDirectory ( startTime : number ) {
917- this . track < IRoomDirectoryEvent > ( "room_directory " , { } , null , {
925+ this . track < IRoomDirectoryDoneEvent > ( "room_directory_done " , { } , null , {
918926 dur : CountlyAnalytics . getTimestamp ( ) - startTime ,
919927 } ) ;
920928 }
@@ -932,7 +940,7 @@ export default class CountlyAnalytics {
932940 key : E [ "key" ] ,
933941 segments ?: Omit < E [ "segmentation" ] , "room_id" | "num_users" | "is_encrypted" | "is_public" > ,
934942 roomId ?: string ,
935- args ?: Partial < Pick < E , "dur" | "sum" > > ,
943+ args ?: Partial < Pick < E , "dur" | "sum" | "timestamp" > > ,
936944 anonymous = false ,
937945 ) {
938946 if ( this . disabled && ! anonymous ) return ;
0 commit comments