From 0e0d479e653d47c4b4338698cf260e7efbc7b79f Mon Sep 17 00:00:00 2001 From: Robert Bogos Date: Fri, 10 Jan 2025 16:56:41 +0200 Subject: [PATCH 1/4] analytics events changes --- unitylibs/core/workflow/workflow-acrobat/action-binder.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/unitylibs/core/workflow/workflow-acrobat/action-binder.js b/unitylibs/core/workflow/workflow-acrobat/action-binder.js index 30aac13..7a9060f 100644 --- a/unitylibs/core/workflow/workflow-acrobat/action-binder.js +++ b/unitylibs/core/workflow/workflow-acrobat/action-binder.js @@ -533,6 +533,7 @@ export default class ActionBinder { ), ); let assetData = null; + const startTime = new Date(); try { await this.showSplashScreen(true); const blobData = await this.getBlobData(file); @@ -611,6 +612,9 @@ export default class ActionBinder { if (!verified) return; const validated = await this.handleValidations(assetData); if (!validated) return; + const endTime = new Date(); + const uploadTime = (endTime - startTime) / 1000; + this.block.dispatchEvent(new CustomEvent(unityConfig.trackAnalyticsEvent, { detail: { event: 'uploadTime', data: { uploadTime } } })); this.block.dispatchEvent(new CustomEvent(unityConfig.trackAnalyticsEvent, { detail: { event: 'uploaded' } })); } @@ -618,7 +622,7 @@ export default class ActionBinder { this.block.dispatchEvent( new CustomEvent( unityConfig.trackAnalyticsEvent, - { detail: { event: eventName } }, + { detail: { event: eventName, data: {count: fileCount}} }, ), ); this.block.dispatchEvent(new CustomEvent(unityConfig.trackAnalyticsEvent, { detail: { event: 'multifile', data: fileCount } })); @@ -636,6 +640,7 @@ export default class ActionBinder { setTimeout(() => { this.updateProgressBar(this.splashScreenEl, 95); if (!this.redirectUrl) return; + this.block.dispatchEvent(new CustomEvent(unityConfig.trackAnalyticsEvent, { detail: { event: 'redirectUrl', data: this.redirectUrl } })); window.location.href = this.redirectUrl; }, 2500); } From 6f9fb7987878cd7eef3b91e8cbcd8cc171e64e66 Mon Sep 17 00:00:00 2001 From: Robert Bogos Date: Mon, 13 Jan 2025 14:31:44 +0200 Subject: [PATCH 2/4] formatting --- unitylibs/core/workflow/workflow-acrobat/action-binder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unitylibs/core/workflow/workflow-acrobat/action-binder.js b/unitylibs/core/workflow/workflow-acrobat/action-binder.js index 7a9060f..0c4701b 100644 --- a/unitylibs/core/workflow/workflow-acrobat/action-binder.js +++ b/unitylibs/core/workflow/workflow-acrobat/action-binder.js @@ -622,7 +622,7 @@ export default class ActionBinder { this.block.dispatchEvent( new CustomEvent( unityConfig.trackAnalyticsEvent, - { detail: { event: eventName, data: {count: fileCount}} }, + { detail: { event: eventName, data: { count: fileCount } } }, ), ); this.block.dispatchEvent(new CustomEvent(unityConfig.trackAnalyticsEvent, { detail: { event: 'multifile', data: fileCount } })); From 4c43cf096315524cfc4f104339baa1ee2ff1008f Mon Sep 17 00:00:00 2001 From: Robert Bogos Date: Mon, 13 Jan 2025 17:18:23 +0200 Subject: [PATCH 3/4] hotfix --- unitylibs/core/workflow/workflow-acrobat/action-binder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unitylibs/core/workflow/workflow-acrobat/action-binder.js b/unitylibs/core/workflow/workflow-acrobat/action-binder.js index 0c4701b..05583d8 100644 --- a/unitylibs/core/workflow/workflow-acrobat/action-binder.js +++ b/unitylibs/core/workflow/workflow-acrobat/action-binder.js @@ -622,7 +622,7 @@ export default class ActionBinder { this.block.dispatchEvent( new CustomEvent( unityConfig.trackAnalyticsEvent, - { detail: { event: eventName, data: { count: fileCount } } }, + { detail: { event: eventName } }, ), ); this.block.dispatchEvent(new CustomEvent(unityConfig.trackAnalyticsEvent, { detail: { event: 'multifile', data: fileCount } })); From 34a6c2d2898e6e26ff8622cd1a98bacc63b0329a Mon Sep 17 00:00:00 2001 From: Robert Bogos Date: Mon, 13 Jan 2025 17:34:58 +0200 Subject: [PATCH 4/4] hotfix --- unitylibs/core/workflow/workflow-acrobat/action-binder.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unitylibs/core/workflow/workflow-acrobat/action-binder.js b/unitylibs/core/workflow/workflow-acrobat/action-binder.js index 05583d8..757e1a8 100644 --- a/unitylibs/core/workflow/workflow-acrobat/action-binder.js +++ b/unitylibs/core/workflow/workflow-acrobat/action-binder.js @@ -278,6 +278,7 @@ export default class ActionBinder { await this.dispatchErrorToast('verb_cookie_not_set', 200, 'Not all cookies found, redirecting anyway', true); await new Promise(r => setTimeout(r, 500)); } + this.block.dispatchEvent(new CustomEvent(unityConfig.trackAnalyticsEvent, { detail: { event: 'redirectComplete', data: this.redirectUrl } })); window.location.href = this.redirectUrl; } catch (e) { await this.showSplashScreen(); @@ -640,7 +641,7 @@ export default class ActionBinder { setTimeout(() => { this.updateProgressBar(this.splashScreenEl, 95); if (!this.redirectUrl) return; - this.block.dispatchEvent(new CustomEvent(unityConfig.trackAnalyticsEvent, { detail: { event: 'redirectUrl', data: this.redirectUrl } })); + this.block.dispatchEvent(new CustomEvent(unityConfig.trackAnalyticsEvent, { detail: { event: 'redirectComplete', data: this.redirectUrl } })); window.location.href = this.redirectUrl; }, 2500); }