From 46677f77392e1a9aa2ff4667cb2c925df6bd8e27 Mon Sep 17 00:00:00 2001 From: Amir Chervinsky Date: Tue, 8 Oct 2024 10:28:28 +0300 Subject: [PATCH] feat: VC product analytics (#551) --- .../entry-ep/entry-ep-view.component.ts | 7 ++- .../views/geo/geo-location.component.ts | 43 ++++++++++++++++--- .../views/session/session.component.html | 2 +- .../viewer-engagement.component.ts | 21 +++++++-- 4 files changed, 61 insertions(+), 12 deletions(-) diff --git a/src/app/modules/entry-ep/entry-ep-view.component.ts b/src/app/modules/entry-ep/entry-ep-view.component.ts index cfbda735a..79f1dd122 100644 --- a/src/app/modules/entry-ep/entry-ep-view.component.ts +++ b/src/app/modules/entry-ep/entry-ep-view.component.ts @@ -244,6 +244,7 @@ export class EntryEpViewComponent implements OnInit, OnDestroy { } public onCuepointChange(): void { + this._analytics.trackButtonClickEvent(ButtonType.Choose, 'VC_session_select_session_dropdown', null, 'VC_session_dashboard'); this.setStartEndDates(this._selectedCuePoint.startTime, this._selectedCuePoint.endTime); } @@ -263,7 +264,11 @@ export class EntryEpViewComponent implements OnInit, OnDestroy { public preExportHandler(): void { this._viewConfig.devices = this._isVirtualClassroom ? {} : null; this._viewConfig.title = {}; // force show title for export - this._analytics.trackButtonClickEvent(ButtonType.Export, 'Events_session_PDF'); + if (this._isVirtualClassroom) { + this._analytics.trackButtonClickEvent(ButtonType.Download, 'VC_session_pdf_download', null, 'VC_session_dashboard'); + } else { + this._analytics.trackButtonClickEvent(ButtonType.Export, 'Events_session_PDF'); + } } public postExportHandler(): void { diff --git a/src/app/modules/entry-ep/views/geo/geo-location.component.ts b/src/app/modules/entry-ep/views/geo/geo-location.component.ts index be029db93..d724d896f 100644 --- a/src/app/modules/entry-ep/views/geo/geo-location.component.ts +++ b/src/app/modules/entry-ep/views/geo/geo-location.component.ts @@ -118,15 +118,27 @@ export class EpGeoComponent implements OnInit, OnDestroy { switch (mode) { case GeoTableModes.cities: reportType = reportTypeMap(KalturaReportType.epWebcastMapOverlayCity); - this._analytics.trackButtonClickEvent(ButtonType.Choose, 'Events_session_countries_dropdown', 'cities'); + if (this.isVirtualClassroom) { + this._analytics.trackButtonClickEvent(ButtonType.Choose, 'VC_session_countries_dropdown', 'cities', 'VC_session_dashboard'); + } else { + this._analytics.trackButtonClickEvent(ButtonType.Choose, 'Events_session_countries_dropdown', 'cities'); + } break; case GeoTableModes.regions: reportType = reportTypeMap(KalturaReportType.epWebcastMapOverlayRegion); - this._analytics.trackButtonClickEvent(ButtonType.Choose, 'Events_session_countries_dropdown', 'regions'); + if (this.isVirtualClassroom) { + this._analytics.trackButtonClickEvent(ButtonType.Choose, 'VC_session_countries_dropdown', 'regions', 'VC_session_dashboard'); + } else { + this._analytics.trackButtonClickEvent(ButtonType.Choose, 'Events_session_countries_dropdown', 'regions'); + } break; case GeoTableModes.countries: reportType = reportTypeMap(KalturaReportType.epWebcastMapOverlayCountry); - this._analytics.trackButtonClickEvent(ButtonType.Choose, 'Events_session_countries_dropdown', 'countries'); + if (this.isVirtualClassroom) { + this._analytics.trackButtonClickEvent(ButtonType.Choose, 'VC_session_countries_dropdown', 'countries', 'VC_session_dashboard'); + } else { + this._analytics.trackButtonClickEvent(ButtonType.Choose, 'Events_session_countries_dropdown', 'countries'); + } break; default: reportType = null; @@ -149,13 +161,25 @@ export class EpGeoComponent implements OnInit, OnDestroy { public onPaginationChanges(event): void { switch (this._tableMode) { case GeoTableModes.countries: - this._analytics.trackButtonClickEvent(ButtonType.Navigate, 'Events_session_countries_paginate', 'countries'); + if (this.isVirtualClassroom) { + this._analytics.trackButtonClickEvent(ButtonType.Navigate, 'VC_session_countries_paginate', 'countries', 'VC_session_dashboard'); + } else { + this._analytics.trackButtonClickEvent(ButtonType.Navigate, 'Events_session_countries_paginate', 'countries'); + } break; case GeoTableModes.regions: - this._analytics.trackButtonClickEvent(ButtonType.Navigate, 'Events_session_countries_paginate', 'regions'); + if (this.isVirtualClassroom) { + this._analytics.trackButtonClickEvent(ButtonType.Navigate, 'VC_session_countries_paginate', 'regions', 'VC_session_dashboard'); + } else { + this._analytics.trackButtonClickEvent(ButtonType.Navigate, 'Events_session_countries_paginate', 'regions'); + } break; case GeoTableModes.cities: - this._analytics.trackButtonClickEvent(ButtonType.Navigate, 'Events_session_countries_paginate', 'cities'); + if (this.isVirtualClassroom) { + this._analytics.trackButtonClickEvent(ButtonType.Navigate, 'VC_session_countries_paginate', 'cities', 'VC_session_dashboard'); + } else { + this._analytics.trackButtonClickEvent(ButtonType.Navigate, 'Events_session_countries_paginate', 'cities'); + } break; } } @@ -210,7 +234,12 @@ export class EpGeoComponent implements OnInit, OnDestroy { this._currentTableLevel = GeoTableModes.regions; this._drillDown = [getCountryName(drillDown, true)]; this._reportType = reportTypeMap(KalturaReportType.epWebcastMapOverlayRegion); - this._analytics.trackButtonClickEvent(ButtonType.Browse, 'Events_session_countries_click_country'); + if (this.isVirtualClassroom) { + this._analytics.trackButtonClickEvent(ButtonType.Browse, 'VC_session_countries_click_country', null, 'VC_session_dashboard'); + } else { + this._analytics.trackButtonClickEvent(ButtonType.Browse, 'Events_session_countries_click_country'); + } + } else if (this._drillDown.length === 1) { this._currentTableLevel = GeoTableModes.cities; this._drillDown.push(getCountryName(drillDown, true)); diff --git a/src/app/modules/entry-ep/views/session/session.component.html b/src/app/modules/entry-ep/views/session/session.component.html index e36433c75..ff8aca885 100644 --- a/src/app/modules/entry-ep/views/session/session.component.html +++ b/src/app/modules/entry-ep/views/session/session.component.html @@ -61,7 +61,7 @@
- +
diff --git a/src/app/modules/entry-ep/views/session/viewer-engagement/viewer-engagement.component.ts b/src/app/modules/entry-ep/views/session/viewer-engagement/viewer-engagement.component.ts index e7e6e3c2d..61cfde8f8 100644 --- a/src/app/modules/entry-ep/views/session/viewer-engagement/viewer-engagement.component.ts +++ b/src/app/modules/entry-ep/views/session/viewer-engagement/viewer-engagement.component.ts @@ -37,6 +37,7 @@ export class EpViewerEngagementComponent implements OnInit { @Input() actualStartDate: Date; // session actual start date @Input() endDate: Date; @Input() duration = 0; + @Input() isVirtualClassroom: boolean; private _order = '-live_view_time'; public _sortField = 'live_view_time'; @@ -144,7 +145,12 @@ export class EpViewerEngagementComponent implements OnInit { public _onPaginationChanged(event: any): void { if (event.page !== (this._pager.pageIndex - 1)) { this._pager.pageIndex = event.page + 1; - this._analytics.trackButtonClickEvent(ButtonType.Navigate, 'Events_session_paginate_users'); + if (this.isVirtualClassroom) { + this._analytics.trackButtonClickEvent(ButtonType.Navigate, 'VC_session_paginate_users', null, 'VC_session_dashboard'); + } else { + this._analytics.trackButtonClickEvent(ButtonType.Navigate, 'Events_session_paginate_users'); + } + this._loadReport({ table: this._dataConfig[ReportDataSection.table] }); } } @@ -163,7 +169,12 @@ export class EpViewerEngagementComponent implements OnInit { 'combined_live_engaged_users_play_time_ratio': 'engagement' }; - this._analytics.trackButtonClickEvent(ButtonType.Filter, 'Events_session_users_sort', trackEventValues[event.field]); + if (this.isVirtualClassroom) { + this._analytics.trackButtonClickEvent(ButtonType.Filter, 'Events_session_users_sort', trackEventValues[event.field], 'VC_session_dashboard'); + } else { + this._analytics.trackButtonClickEvent(ButtonType.Filter, 'Events_session_users_sort', trackEventValues[event.field]); + } + this._loadReport({ table: this._dataConfig[ReportDataSection.table] }); } } @@ -187,6 +198,10 @@ export class EpViewerEngagementComponent implements OnInit { } public onRowExpanded(): void { - this._analytics.trackButtonClickEvent(ButtonType.Expand, 'Events_session_expand_user'); + if (this.isVirtualClassroom) { + this._analytics.trackButtonClickEvent(ButtonType.Expand, 'VC_session_expand_user', null, 'VC_session_dashboard'); + } else { + this._analytics.trackButtonClickEvent(ButtonType.Expand, 'Events_session_expand_user'); + } } }