Skip to content

Commit

Permalink
feat: VC product analytics (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
amirch1 authored Oct 8, 2024
1 parent 114a464 commit 46677f7
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 12 deletions.
7 changes: 6 additions & 1 deletion src/app/modules/entry-ep/entry-ep-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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 {
Expand Down
43 changes: 36 additions & 7 deletions src/app/modules/entry-ep/views/geo/geo-location.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<div [class.kHidden]="exporting" class="kTableContainer">
<ng-container *ngIf="_currentTab === _reportTabs.viewer">
<div class="kReportContainer">
<app-ep-viewer-engagement [startDate]="_startDate" [actualStartDate]="actualStartDate" [endDate]="endDate" [entryIdIn]="entryIdIn" [duration]="_duration"></app-ep-viewer-engagement>
<app-ep-viewer-engagement [isVirtualClassroom]="isVirtualClassroom" [startDate]="_startDate" [actualStartDate]="actualStartDate" [endDate]="endDate" [entryIdIn]="entryIdIn" [duration]="_duration"></app-ep-viewer-engagement>
</div>
</ng-container>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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] });
}
}
Expand All @@ -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] });
}
}
Expand All @@ -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');
}
}
}

0 comments on commit 46677f7

Please sign in to comment.