Skip to content

Commit

Permalink
chore: Product analytics (#547)
Browse files Browse the repository at this point in the history
* chore: export product analytics AN-23245

* chore: time filter product analytics AN-23247

* chore: filter product analytics AN-23246
  • Loading branch information
amirch1 authored Oct 8, 2024
1 parent b05f8df commit 114a464
Show file tree
Hide file tree
Showing 22 changed files with 136 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<div class="kControls">
<app-export-csv *ngIf="_contentInteractionsViewConfig.export"
name="Content Interactions"
feature="content-interaction"
[reports]="_exportConfig"
[refineFilter]="_refineFilter"
[dateFilter]="_dateFilter"></app-export-csv>
Expand All @@ -17,6 +18,7 @@
</div>
<app-date-filter #dateFilter
name="content-interactions"
feature="content-interaction"
[dateRange]="_dateRange"
[selectedTimeUnit]="_timeUnit"
(filterChange)="_onDateFilterChange($event)"></app-date-filter>
Expand All @@ -25,6 +27,7 @@

<div class="kReportContainer kNoPadding">
<app-refine-filter name="refine-filter"
feature="content-interaction"
[viewConfig]="_contentInteractionsViewConfig.refineFilter"
[opened]="_refineFilterOpened"
[dateFilter]="_dateFilter"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
(postExport)="postExportHandler()" (exporting)="onExporting($event)"></app-pdf-export>
<app-export-csv *ngIf="_engagementViewConfig.export"
name="Engagement"
feature="engagement"
[width]="290"
[reports]="_exportConfig"
[refineFilter]="_refineFilter"
Expand All @@ -23,13 +24,15 @@
</div>
<app-date-filter #dateFilter [exporting]="_exporting"
name="engagement"
feature="engagement"
[dateRange]="_dateRange"
[selectedTimeUnit]="_timeUnit"
(filterChange)="_onDateFilterChange($event)"></app-date-filter>
</div>

<div class="kReportContainer kNoPadding">
<app-refine-filter name="engagement" #refineFilter
feature="engagement"
[viewConfig]="_engagementViewConfig.refineFilter"
[exporting]="_exporting"
[opened]="_refineFilterOpened"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<span class="kTitle">{{'app.audience.geo.title' | translate}}</span>
<app-export-csv *ngIf="_geoViewConfig.export"
name="Geo Location"
feature="geo-location"
[reports]="_exportConfig"
[refineFilter]="_refineFilter"
[dateFilter]="_dateFilter"></app-export-csv>
Expand All @@ -17,6 +18,7 @@
</div>

<app-date-filter name="geo"
feature="geo-location"
[dateRange]="_dateRange"
[dateRangeType]="_dateRangeType"
[showCompare]="false"
Expand All @@ -25,6 +27,7 @@

<div class="kReportContainer kNoPadding">
<app-geo-filter [viewConfig]="_geoViewConfig.refineFilter"
feature="geo-location"
[opened]="_refineFilterOpened"
[dateFilter]="_dateFilter"
[selectedFilters]="_selectedRefineFilters"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<span class="kTitle">{{'app.audience.technology.title' | translate}}</span>
<app-export-csv *ngIf="_technologyViewConfig.export"
name="Technology"
feature="technology"
[width]="260"
[reports]="_exportConfig"
[dateFilter]="_filterEvent"></app-export-csv>
Expand All @@ -24,13 +25,15 @@
</div>
<app-date-filter #dateFilter
name="technology"
feature="technology"
[dateRange]="_dateRange"
[showCompare]="false"
(filterChange)="_onDateFilterChange($event)"></app-date-filter>
</div>
<div class="kReportContainer kNoPadding">
<app-geo-filter [viewConfig]="_technologyViewConfig.refineFilter"
[opened]="_refineFilterOpened"
feature="technology"
[dateFilter]="_filterEvent"
[selectedFilters]="_selectedRefineFilters"
(closeFilters)="_refineFilterOpened = false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<span class="kTitle">{{'app.bandwidth.usersStorage' | translate}}</span>
<app-export-csv *ngIf="_endUserViewConfig.export"
name="End User Storage"
feature="usage_end_users"
[reports]="_exportConfig"
[dateFilter]="_dateFilter"></app-export-csv>
<div *ngIf="_endUserViewConfig.refineFilter"
Expand All @@ -15,6 +16,7 @@
</div>
<app-date-filter #dateFilter
name="end-user"
feature="usage_end_users"
[showHours]="false"
[dateRange]="_dateRange"
[dateRangeType]="_dateRangeType"
Expand All @@ -24,6 +26,7 @@
<div class="kReportContainer kNoPadding">
<app-end-user-filter [opened]="_refineFilterOpened"
[dateFilter]="_dateFilter"
feature="usage_end_users"
[selectedFilters]="_selectedRefineFilters"
(closeFilters)="_refineFilterOpened = false"
(filterChange)="_onRefineFilterChange($event)"></app-end-user-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {OverviewDateRange} from "./overview-date-range.type";
import {DateFilterUtils} from "shared/components/date-filter/date-filter-utils";
import {TranslateService} from "@ngx-translate/core";
import {KalturaReportInterval} from "kaltura-ngx-client";
import {AppAnalytics, AuthService} from "shared/services";
import {AppAnalytics, AuthService, ButtonType} from "shared/services";
import {SelectItem} from "primeng/api";
import {analyticsConfig} from "configuration/analytics-config";

Expand Down Expand Up @@ -89,9 +89,9 @@ export class OverviewDateFilterComponent implements OnInit {
}

// quarterly date range logic
const quarterMonths = [1,4,7,10];
const quarterMonths = [1, 4, 7, 10];
let quarterMonth = quarterMonths.find(month => month <= currentMonth && (currentMonth - month) < 3);
const quarterIndex = Math.floor((quarterMonth -1) / 3) + 1;
const quarterIndex = Math.floor((quarterMonth - 1) / 3) + 1;
this.quarterlyDateRangeItems = [{
key: 'quarter-0',
label: this._translate.instant('app.dateFilter.currentQuarter'),
Expand Down Expand Up @@ -149,7 +149,7 @@ export class OverviewDateFilterComponent implements OnInit {
key: `month-${i}`,
label: `${monthName} ${year}`,
startDate: DateFilterUtils.toServerDate(new Date(`${year}-${getMonthString(month)}-${dayStr}`), true),
endDate: DateFilterUtils.toServerDate(new Date(year,month,0), false),
endDate: DateFilterUtils.toServerDate(new Date(year, month, 0), false),
interval: KalturaReportInterval.months,
isSpecific: false
});
Expand All @@ -158,8 +158,9 @@ export class OverviewDateFilterComponent implements OnInit {
}

public apply(): void {
this._analytics.trackClickEvent('Calendar');
this.updateDataRanges();
let value = this.selectedView === 'preset' ? this.selectedDateRange.label + '|compare_off' : 'specific|compare_off';
this._analytics.trackButtonClickEvent(ButtonType.Filter, 'Calendar', value, 'usage_overview');
}

updateDataRanges() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<span class="kTitle">{{'app.modules.bandwidth' | translate}}</span>
<app-export-csv *ngIf="_storageViewConfig.export"
name="Storage"
feature="usage_overview"
[reports]="_exportConfig"
[dateFilter]="_dateFilter"></app-export-csv>
<div *ngIf="_storageViewConfig.refineFilter"
Expand All @@ -19,6 +20,7 @@
<div class="kReportContainer kNoPadding">
<app-storage-filter [opened]="_refineFilterOpened"
[dateFilter]="_dateFilter"
feature="usage_overview"
[selectedFilters]="_selectedRefineFilters"
(closeFilters)="_refineFilterOpened = false"
(filterChange)="_onRefineFilterChange($event)"></app-storage-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<span class="kTitle">{{'app.bandwidth.publisherStorage' | translate}}</span>
<app-export-csv *ngIf="_publisherViewConfig.export"
name="Publisher Storage"
feature="usage_publishers_bandwidth_storage"
[reports]="_exportConfig"
[dateFilter]="_dateFilter"></app-export-csv>
<div *ngIf="_publisherViewConfig.refineFilter"
Expand All @@ -15,6 +16,7 @@
</div>
<app-date-filter #dateFilter
name="storage"
feature="usage_publishers_bandwidth_storage"
[showHours]="false"
[dateRange]="_dateRange"
[dateRangeType]="_dateRangeType"
Expand All @@ -23,6 +25,7 @@

<div class="kReportContainer kNoPadding">
<app-refine-filter name="engagement"
feature="usage_publishers_bandwidth_storage"
[locationFiltersWarning]="'app.bandwidth.locationFiltersWarning' | translate"
[viewConfig]="_publisherViewConfig.refineFilter"
[showAutocompleteGroup]="false"
Expand Down
3 changes: 3 additions & 0 deletions src/app/modules/category/category-view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle kTruncateTitle" [kTooltip]="_categor
<div class="kHeaderRight" [class.noTitle]="!_viewConfig.title">
<app-export-csv aria-label="Export" #export
role="button"
feature="category"
[class.kHidden]="!_viewConfig.export" name="Category"
[reports]="_exportConfig"
[refineFilter]="_refineFilter"
Expand All @@ -26,6 +27,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle kTruncateTitle" [kTooltip]="_categor
</div>
<app-date-filter #dateFilter
name="category"
feature="category"
[dateRange]="_dateRange"
[selectedTimeUnit]="_timeUnit"
[creationDate]="_creationDate"
Expand Down Expand Up @@ -57,6 +59,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle kTruncateTitle" [kTooltip]="_categor

<app-cat-filter class="kRefineFiltersHost"
name="category" #categoryFilter
feature="category"
[category]="_category"
[viewConfig]="_viewConfig.refineFilter"
[opened]="_refineFilterOpened"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<span class="kTitle">{{'app.contributors.title' | translate}}</span>
<app-export-csv *ngIf="_contributorsViewConfig.export"
name="Top Contributors"
feature="contributors"
[reports]="_exportConfig"
[refineFilter]="_refineFilter"
[dateFilter]="_dateFilter"></app-export-csv>
Expand All @@ -16,13 +17,14 @@
</div>
<app-date-filter #dateFilter
name="contributors"
feature="contributors"
[dateRange]="_dateRange"
[selectedTimeUnit]="_timeUnit"
(filterChange)="_onDateFilterChange($event)"></app-date-filter>
</div>

<div class="kReportContainer kNoPadding">
<app-contributors-filter name="contributors"
<app-contributors-filter name="contributors" feature="contributors"
[viewConfig]="_contributorsViewConfig.refineFilter"
[opened]="_refineFilterOpened"
[dateFilter]="_dateFilter"
Expand Down
1 change: 1 addition & 0 deletions src/app/modules/entry-ep/entry-ep-view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle kTruncateTitle" [kTooltip]="_entry?.
</div>
<div class="kHeaderRight" [class.noTitle]="!_viewConfig.title">
<app-export-csv name="Viewers Engagement" *ngIf="!_exporting"
feature="{{_isVirtualClassroom ? 'VC_session' : 'events_session'}}"
[entryId]="_liveEntryIds"
[reports]="_exportConfig"
(onExport)="onExport()"
Expand Down
3 changes: 2 additions & 1 deletion src/app/modules/entry-live/entry-live-view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
</div>
<app-export-csv *ngIf="_entryLiveViewConfig.export"
name="Live Entry"
feature="RT"
[width]="380"
[reports]="_exportConfig"
[entryId]="_entryId"></app-export-csv>
Expand All @@ -30,7 +31,7 @@

<app-entry-details *ngIf="_entryLiveViewConfig.details"
[entry]="_entry" [showOwner]="_entryLiveViewConfig.owner" (navigateToEntry)="_navigateToEntry()"></app-entry-details>
<app-live-filters class="kRefineFiltersHost" name="entry-webcast"
<app-live-filters class="kRefineFiltersHost" name="entry-webcast" feature="RT"
[viewConfig]="_refineFilter"
[opened]="_refineFilterOpened"
[entryId]="_entryId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle kTruncateTitle" [kTooltip]="_entry?.
(postExport)="postExportHandler()" (exporting)="onExporting($event)"></app-pdf-export>
<app-export-csv aria-label="Export"
role="button"
feature="webcast"
*ngIf="_viewConfig.export" name="entry"
[reports]="_exportConfig"
[refineFilter]="_refineFilter"
Expand All @@ -30,6 +31,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle kTruncateTitle" [kTooltip]="_entry?.
</div>
<app-date-filter #dateFilter
name="entry"
feature="webcast"
[exporting]="_exporting"
[showCompare]="false"
[dateRange]="_dateRange"
Expand Down Expand Up @@ -63,7 +65,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle kTruncateTitle" [kTooltip]="_entry?.
</a>
</div>

<app-entry-webcast-filter class="kRefineFiltersHost" name="entry-webcast"
<app-entry-webcast-filter class="kRefineFiltersHost" name="entry-webcast" feature="webcast"
[viewConfig]="_viewConfig.refineFilter"
[exporting]="_exporting"
[opened]="_refineFilterOpened"
Expand Down
4 changes: 3 additions & 1 deletion src/app/modules/entry/views/image/entry-view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ <h1 class="kTitle kTruncateTitle" *ngIf="_viewConfig.title" [kTooltip]="_entryNa
aria-label="Export"
role="button"
name="Image Entry"
feature="entry-image"
[reports]="_exportConfig"
[refineFilter]="_refineFilter"
[dateFilter]="_dateFilter"
Expand All @@ -24,6 +25,7 @@ <h1 class="kTitle kTruncateTitle" *ngIf="_viewConfig.title" [kTooltip]="_entryNa
</div>
<app-date-filter #dateFilter
name="entry"
feature="entry-image"
[dateRange]="_dateRange"
[selectedTimeUnit]="_timeUnit"
[creationDate]="_creationDate"
Expand All @@ -45,7 +47,7 @@ <h1 class="kTitle kTruncateTitle" *ngIf="_viewConfig.title" [kTooltip]="_entryNa
</a>
</div>

<app-entry-filter class="kRefineFiltersHost"
<app-entry-filter class="kRefineFiltersHost" feature="entry-image"
[viewConfig]="_viewConfig.refineFilter"
[opened]="_refineFilterOpened"
[dateFilter]="_dateFilter"
Expand Down
4 changes: 3 additions & 1 deletion src/app/modules/entry/views/video/entry-view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle kTruncateTitle" [kTooltip]="_entryNa
<div class="kHeaderRight" [class.noTitle]="!_viewConfig.title">
<app-export-csv aria-label="Export"
role="button"
feature="entry-video"
*ngIf="_viewConfig.export" name="Video Entry"
[reports]="_exportConfig"
[refineFilter]="_refineFilter"
Expand All @@ -23,6 +24,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle kTruncateTitle" [kTooltip]="_entryNa
</div>
<app-date-filter #dateFilter
name="entry"
feature="entry-video"
[dateRange]="_dateRange"
[selectedTimeUnit]="_timeUnit"
[creationDate]="_creationDate"
Expand All @@ -44,7 +46,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle kTruncateTitle" [kTooltip]="_entryNa
</a>
</div>

<app-entry-filter class="kRefineFiltersHost"
<app-entry-filter class="kRefineFiltersHost" feature="entry-video"
[viewConfig]="_viewConfig.refineFilter"
[opened]="_refineFilterOpened"
[dateFilter]="_dateFilter"
Expand Down
4 changes: 3 additions & 1 deletion src/app/modules/playlist/views/path/path-view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<h1 *ngIf="_viewConfig.title" class="kTitle">{{_playlistName}}</h1>
<div class="kHeaderRight" [class.noTitle]="!_viewConfig.title">
<app-export-csv *ngIf="_viewConfig.export" name="Interactive Video"
feature="path"
[reports]="_exportConfig"
[refineFilter]="_refineFilter"
[dateFilter]="_dateFilter"
Expand All @@ -24,6 +25,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle">{{_playlistName}}</h1>

<app-date-filter #dateFilter
name="entry"
feature="path"
[dateRange]="_dateRange"
[selectedTimeUnit]="_timeUnit"
[creationDate]="_creationDate"
Expand All @@ -39,7 +41,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle">{{_playlistName}}</h1>
<span class="kOwner">{{owner}}</span>
</div>

<app-playlist-filter class="kRefineFiltersHost"
<app-playlist-filter class="kRefineFiltersHost" feature="path"
[viewConfig]="_viewConfig.refineFilter"
[opened]="_refineFilterOpened"
[dateFilter]="_dateFilter"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle">{{_playlistName}}</h1>
<app-export-csv [class.kHidden]="!_viewConfig.export" name="Manual Playlist" #export
aria-label="Export"
role="button"
feature="playlist"
[reports]="_exportConfig"
[refineFilter]="_refineFilter"
[dateFilter]="_dateFilter"
Expand All @@ -25,6 +26,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle">{{_playlistName}}</h1>

<app-date-filter #dateFilter
name="manual-playlist"
feature="playlist"
[dateRange]="_dateRange"
[selectedTimeUnit]="_timeUnit"
[creationDate]="_creationDate"
Expand Down Expand Up @@ -54,7 +56,7 @@ <h1 *ngIf="_viewConfig.title" class="kTitle">{{_playlistName}}</h1>
</a>
</div>

<app-refine-filter name="engagement"
<app-refine-filter name="engagement" feature="playlist"
[viewConfig]="_viewConfig.refineFilter"
[opened]="_refineFilterOpened"
[dateFilter]="_dateFilter"
Expand Down
Loading

0 comments on commit 114a464

Please sign in to comment.