analytics

This commit is contained in:
Sofia Papacharalampous 2024-07-09 10:48:07 +03:00
parent 46cb75dee7
commit 69c1ae101f
3 changed files with 4 additions and 5 deletions

View File

@ -89,7 +89,7 @@ export class FileTransformerService extends BaseService {
const filename = this.fileUtils.getFilenameFromContentDispositionHeader(result.headers.get('Content-Disposition')); const filename = this.fileUtils.getFilenameFromContentDispositionHeader(result.headers.get('Content-Disposition'));
FileSaver.saveAs(blob, filename); FileSaver.saveAs(blob, filename);
this.analyticsService.trackDownload('dmps', format, id.toString()); this.analyticsService.trackDownload(AnalyticsService.trackDmp, format, id.toString());
} }
}, },
error => this.httpErrorHandlingService.handleBackedRequestError(error)); error => this.httpErrorHandlingService.handleBackedRequestError(error));
@ -118,7 +118,7 @@ export class FileTransformerService extends BaseService {
const filename = this.fileUtils.getFilenameFromContentDispositionHeader(result.headers.get('Content-Disposition')); const filename = this.fileUtils.getFilenameFromContentDispositionHeader(result.headers.get('Content-Disposition'));
FileSaver.saveAs(blob, filename); FileSaver.saveAs(blob, filename);
this.analyticsService.trackDownload('descriptions', format, id.toString()); this.analyticsService.trackDownload(AnalyticsService.trackDescriptions, format, id.toString());
} }
}, },
error => this.httpErrorHandlingService.handleBackedRequestError(error)); error => this.httpErrorHandlingService.handleBackedRequestError(error));

View File

@ -49,7 +49,6 @@ export class AnalyticsService {
//#region trackDownload //#region trackDownload
public static trackDmp: string = "dmps" public static trackDmp: string = "dmps"
public static trackDatasets: string = "datasets"
public static trackDescriptions: string = "descriptions" public static trackDescriptions: string = "descriptions"
//#endregion //#endregion
@ -81,7 +80,7 @@ export class AnalyticsService {
} }
} }
trackDownload(category: "dmps" | "datasets" | "descriptions", type: string, id: string): void { trackDownload(category: string, type: string, id: string): void {
const analytics: AnalyticsProviders = this.configurationService.analyticsProviders; const analytics: AnalyticsProviders = this.configurationService.analyticsProviders;
for (let provider of analytics.providers) { for (let provider of analytics.providers) {

View File

@ -38,7 +38,7 @@ export class MatomoService {
} }
} }
trackDownload(category: "dmps" | "datasets" | "descriptions", type: string, id: string): void { trackDownload(category: string, type: string, id: string): void {
if (this.configurationService.matomoEnabled) { if (this.configurationService.matomoEnabled) {
var principalid = this.authService.userId(); var principalid = this.authService.userId();
if (principalid != null) { this.matomoTracker.setUserId(principalid.toString()); } if (principalid != null) { this.matomoTracker.setUserId(principalid.toString()); }