GitLab steht aufgrund wichtiger Wartungsarbeiten am Montag, den 8. März, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Adds conversion event tracking if the webapp is installed. Fixes tracking for...

Adds conversion event tracking if the webapp is installed. Fixes tracking for quiz owners entering the lobby
parent d504c3c0
......@@ -184,7 +184,11 @@ export class QuizLobbyComponent implements OnInit, OnDestroy {
this.headerLabelService.headerLabel = this.quizService.quiz.name;
this.trackingService.trackConversionEvent({ action: QuizLobbyComponent.TYPE });
this.trackingService.trackConversionEvent({
action: QuizLobbyComponent.TYPE,
label: 'Quiz started',
});
this.addFooterElementsAsOwner();
}
......
......@@ -9,7 +9,6 @@ import { Subject, Subscription } from 'rxjs';
import { distinctUntilChanged, filter, takeUntil } from 'rxjs/operators';
import themeData from '../../../assets/themeData.json';
import { environment } from '../../../environments/environment';
import { BeforeInstallPromptEvent } from '../../lib/BeforeInstallPrompt';
import { QuizEntity } from '../../lib/entities/QuizEntity';
import { DbState, DeprecatedDb, DeprecatedKeys } from '../../lib/enums/enums';
import { StatusProtocol } from '../../lib/enums/Message';
......@@ -23,6 +22,7 @@ import { QuizService } from '../../service/quiz/quiz.service';
import { SharedService } from '../../service/shared/shared.service';
import { StorageService } from '../../service/storage/storage.service';
import { ThemesService } from '../../service/themes/themes.service';
import { TrackingService } from '../../service/tracking/tracking.service';
import { UpdateCheckService } from '../../service/update-check/update-check.service';
import { UserService } from '../../service/user/user.service';
......@@ -52,7 +52,7 @@ export class RootComponent implements OnInit, AfterViewInit {
private storageService: StorageService,
private quizService: QuizService,
private connectionService: ConnectionService,
private messageQueue: SimpleMQ,
private messageQueue: SimpleMQ, private trackingService: TrackingService,
) {
this.themeService.themeChanged.pipe(takeUntil(this._destroy), distinctUntilChanged(), filter(t => !!t)).subscribe(themeName => {
if (String(themeName) === 'default') {
......@@ -138,8 +138,11 @@ export class RootComponent implements OnInit, AfterViewInit {
return;
}
window.addEventListener('beforeinstallprompt', (event: BeforeInstallPromptEvent) => {
event.prompt();
window.addEventListener('appinstalled', () => {
this.trackingService.trackConversionEvent({
action: this.fetchChildComponent(this.activatedRoute).TYPE,
label: 'WebApp installed',
});
});
this.router.events.pipe(takeUntil(this._destroy), filter(nav => nav instanceof NavigationEnd)).subscribe(() => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment