From b2d2b97e99f2ac504feb74663e476b1a6bde845c Mon Sep 17 00:00:00 2001 From: Andrei Tuicu Date: Sat, 20 Apr 2024 21:41:10 +0200 Subject: [PATCH 1/5] fix: Tradeoff - Load Adobe Launch in head if cached --- aemeds/scripts/delayed.js | 5 +++++ head.html | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/aemeds/scripts/delayed.js b/aemeds/scripts/delayed.js index a8a9a2a2..0a1cd7ce 100644 --- a/aemeds/scripts/delayed.js +++ b/aemeds/scripts/delayed.js @@ -4,3 +4,8 @@ import { sampleRUM } from './aem.js'; // Core Web Vitals RUM collection sampleRUM('cwv'); // add more delayed functionality here + +if (!window.sessionStorage.getItem('adobeLaunchCached')) { + loadAdobeDTM(); + sessionStorage.setItem('adobeLaunchCached', 'true'); +} \ No newline at end of file diff --git a/head.html b/head.html index 5f3b8e5d..1b78579c 100644 --- a/head.html +++ b/head.html @@ -61,5 +61,7 @@ } } - loadAdobeDTM(); + if (sessionStorage.getItem('adobeLaunchCached')) { + loadAdobeDTM(); + } From c003d67fc531e62b1b047718dabdcae5bfa8fcfc Mon Sep 17 00:00:00 2001 From: Andrei Tuicu Date: Sat, 20 Apr 2024 21:48:42 +0200 Subject: [PATCH 2/5] fix: Tradeoff - Load Adobe Launch in head if cached --- aemeds/scripts/delayed.js | 4 +++- head.html | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/aemeds/scripts/delayed.js b/aemeds/scripts/delayed.js index 0a1cd7ce..972d3f26 100644 --- a/aemeds/scripts/delayed.js +++ b/aemeds/scripts/delayed.js @@ -6,6 +6,8 @@ sampleRUM('cwv'); // add more delayed functionality here if (!window.sessionStorage.getItem('adobeLaunchCached')) { + // defined in the head of the page + // eslint-disable-next-line no-undef loadAdobeDTM(); sessionStorage.setItem('adobeLaunchCached', 'true'); -} \ No newline at end of file +} diff --git a/head.html b/head.html index 1b78579c..1b300738 100644 --- a/head.html +++ b/head.html @@ -61,6 +61,7 @@ } } + // otherwise to load Adobe Launch Delayed if (sessionStorage.getItem('adobeLaunchCached')) { loadAdobeDTM(); } From 40708a38e4aee0a6562251748b299dfc3f29f706 Mon Sep 17 00:00:00 2001 From: Andrei Tuicu Date: Sat, 20 Apr 2024 22:06:31 +0200 Subject: [PATCH 3/5] fix: Tradeoff - Load Adobe Launch in head if cached --- aemeds/scripts/scripts.js | 5 +++++ head.html | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aemeds/scripts/scripts.js b/aemeds/scripts/scripts.js index 9bc5bf85..b5fbd5ba 100644 --- a/aemeds/scripts/scripts.js +++ b/aemeds/scripts/scripts.js @@ -513,6 +513,11 @@ async function loadEager(doc) { } try { + // otherwise load Adobe Launch Delayed + if (sessionStorage.getItem('adobeLaunchCached')) { + loadAdobeDTM(); + } + /* if desktop (proxy for fast connection) or fonts already loaded, load fonts.css */ if (window.innerWidth >= 900 || sessionStorage.getItem('fonts-loaded')) { loadFonts(); diff --git a/head.html b/head.html index 1b300738..357f3f13 100644 --- a/head.html +++ b/head.html @@ -60,9 +60,4 @@ loadScript(stage, { async: "" }); } } - - // otherwise to load Adobe Launch Delayed - if (sessionStorage.getItem('adobeLaunchCached')) { - loadAdobeDTM(); - } From a17367a86aba78c7a96e863cb458632181e0d0ef Mon Sep 17 00:00:00 2001 From: Andrei Tuicu Date: Sat, 20 Apr 2024 22:13:19 +0200 Subject: [PATCH 4/5] Revert "fix: Tradeoff - Load Adobe Launch in head if cached" This reverts commit 40708a38e4aee0a6562251748b299dfc3f29f706. --- aemeds/scripts/scripts.js | 5 ----- head.html | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aemeds/scripts/scripts.js b/aemeds/scripts/scripts.js index b5fbd5ba..9bc5bf85 100644 --- a/aemeds/scripts/scripts.js +++ b/aemeds/scripts/scripts.js @@ -513,11 +513,6 @@ async function loadEager(doc) { } try { - // otherwise load Adobe Launch Delayed - if (sessionStorage.getItem('adobeLaunchCached')) { - loadAdobeDTM(); - } - /* if desktop (proxy for fast connection) or fonts already loaded, load fonts.css */ if (window.innerWidth >= 900 || sessionStorage.getItem('fonts-loaded')) { loadFonts(); diff --git a/head.html b/head.html index 357f3f13..1b300738 100644 --- a/head.html +++ b/head.html @@ -60,4 +60,9 @@ loadScript(stage, { async: "" }); } } + + // otherwise to load Adobe Launch Delayed + if (sessionStorage.getItem('adobeLaunchCached')) { + loadAdobeDTM(); + } From ed717a97d8a5c13c4a0da179519b35f53d760326 Mon Sep 17 00:00:00 2001 From: Andrei Tuicu Date: Mon, 22 Apr 2024 10:10:55 +0200 Subject: [PATCH 5/5] fix: Tradeoff - Load Adobe Launch in head if cached --- aemeds/scripts/delayed.js | 4 ++-- head.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aemeds/scripts/delayed.js b/aemeds/scripts/delayed.js index 972d3f26..ce6a51e2 100644 --- a/aemeds/scripts/delayed.js +++ b/aemeds/scripts/delayed.js @@ -5,9 +5,9 @@ import { sampleRUM } from './aem.js'; sampleRUM('cwv'); // add more delayed functionality here -if (!window.sessionStorage.getItem('adobeLaunchCached')) { +if (!window.sessionStorage.getItem('com.adobe.reactor.adobeLaunchCached')) { // defined in the head of the page // eslint-disable-next-line no-undef loadAdobeDTM(); - sessionStorage.setItem('adobeLaunchCached', 'true'); + sessionStorage.setItem('com.adobe.reactor.adobeLaunchCached', 'true'); } diff --git a/head.html b/head.html index 1b300738..1dfb38f0 100644 --- a/head.html +++ b/head.html @@ -62,7 +62,7 @@ } // otherwise to load Adobe Launch Delayed - if (sessionStorage.getItem('adobeLaunchCached')) { + if (sessionStorage.getItem('com.adobe.reactor.adobeLaunchCached')) { loadAdobeDTM(); }