if matomo is undefined, don't try to use it

This commit is contained in:
nymkappa 2024-02-22 11:07:50 +01:00
parent b0d34d4e48
commit dc50b40b69
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04

View File

@ -141,9 +141,11 @@ export class EnterpriseService {
page() { page() {
const matomo = this.getMatomo(); const matomo = this.getMatomo();
if (matomo) {
matomo.setCustomUrl(this.getCustomUrl()); matomo.setCustomUrl(this.getCustomUrl());
matomo.trackPageView(); matomo.trackPageView();
} }
}
private getCustomUrl(): string { private getCustomUrl(): string {
let url = window.location.origin + '/'; let url = window.location.origin + '/';