From 0e4451b953f2b229aa2520b9e3c734c5c91c585a Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle <patrizio@bekerle.com> Date: Tue, 16 Feb 2021 10:30:20 +0100 Subject: [PATCH] Migrate Matomo events to provider --- assets/dbp-signature.html.ejs | 2 +- src/dbp-official-signature-pdf-upload.js | 5 ++--- src/dbp-qualified-signature-pdf-upload.js | 10 ++++------ src/dbp-signature-verification-full.js | 5 ++--- vendor/toolkit | 2 +- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/assets/dbp-signature.html.ejs b/assets/dbp-signature.html.ejs index 460e26b..4422aa7 100644 --- a/assets/dbp-signature.html.ejs +++ b/assets/dbp-signature.html.ejs @@ -64,7 +64,7 @@ initial-file-handling-state> <<%= name %> subscribe="lang:lang,entry-point-url:entry-point-url" - auth requested-login-status + auth requested-login-status analytics-event src="<%= getUrl(name + '.topic.metadata.json') %>" base-path="<%= getUrl('') %>" keycloak-config='{"url": "<%= keyCloakBaseURL %>", "realm": "tugraz", "clientId": "<%= keyCloakClientId %>", "silentCheckSsoRedirectUri": "<%= getUrl('silent-check-sso.html') %>"}' diff --git a/src/dbp-official-signature-pdf-upload.js b/src/dbp-official-signature-pdf-upload.js index b461f67..3e1d6f3 100644 --- a/src/dbp-official-signature-pdf-upload.js +++ b/src/dbp-official-signature-pdf-upload.js @@ -260,9 +260,8 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem // this triggers the correct update() execution this.errorFilesCount++; - if (window._paq !== undefined) { - window._paq.push(['trackEvent', 'officiallySigning', 'SigningFailed', file.json["hydra:description"]]); - } + this.sendSetPropertyEvent('analytics-event', { + 'category': 'officiallySigning', 'action': 'SigningFailed', 'name': file.json["hydra:description"]}); } /** diff --git a/src/dbp-qualified-signature-pdf-upload.js b/src/dbp-qualified-signature-pdf-upload.js index 378edeb..be69cd9 100644 --- a/src/dbp-qualified-signature-pdf-upload.js +++ b/src/dbp-qualified-signature-pdf-upload.js @@ -337,9 +337,8 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle // this triggers the correct update() execution that.signedFilesCount++; - if (window._paq !== undefined) { - window._paq.push(['trackEvent', 'QualifiedlySigning', 'DocumentSigned', document.contentSize]); - } + this.sendSetPropertyEvent('analytics-event', { + 'category': 'QualifiedlySigning', 'action': 'DocumentSigned', 'name': document.contentSize}); }).catch(error => { let file = this.currentFile; // let's override the json to inject an error message @@ -380,9 +379,8 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle // this triggers the correct update() execution this.errorFilesCount++; - if (window._paq !== undefined) { - window._paq.push(['trackEvent', 'QualifiedlySigning', 'SigningFailed', file.json["hydra:description"]]); - } + this.sendSetPropertyEvent('analytics-event', { + 'category': 'QualifiedlySigning', 'action': 'SigningFailed', 'name': file.json["hydra:description"]}); } /** diff --git a/src/dbp-signature-verification-full.js b/src/dbp-signature-verification-full.js index 05f4759..8cc413c 100644 --- a/src/dbp-signature-verification-full.js +++ b/src/dbp-signature-verification-full.js @@ -181,9 +181,8 @@ class SignatureVerificationFull extends ScopedElementsMixin(DBPSignatureLitEleme // this triggers the correct update() execution this.errorFilesCount++; - if (window._paq !== undefined) { - window._paq.push(['trackEvent', 'officiallyVerification', 'VerificationFailed', file.json["hydra:description"]]); - } + this.sendSetPropertyEvent('analytics-event', { + 'category': 'officiallyVerification', 'action': 'VerificationFailed', 'name': file.json["hydra:description"]}); } /** diff --git a/vendor/toolkit b/vendor/toolkit index 623483a..6f58ac8 160000 --- a/vendor/toolkit +++ b/vendor/toolkit @@ -1 +1 @@ -Subproject commit 623483aa9cebbe78568b9087949237d565a6480c +Subproject commit 6f58ac8c782bca5113cc9c7c9c12c7af5fdc3d73 -- GitLab