Skip to content

Commit

Permalink
chore: try moving launch container up for perf testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ramboz committed Jun 26, 2024
1 parent f54ae65 commit 9d882a6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
<script src="/solutions/scripts/utils.js" type="module"></script>
<script src="/solutions/scripts/scripts.js" type="module"></script>
<link rel="stylesheet" href="/solutions/styles/styles.css"/>
<script src="https://assets.adobedtm.com/8a93f8486ba4/5492896ad67e/launch-b1f76be4d2ee.min.js" async></script>

26 changes: 13 additions & 13 deletions solutions/scripts/delayed.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// eslint-disable-next-line import/no-cycle
import {
loadScript,
// loadScript,
sampleRUM,
fetchPlaceholders,

Check failure on line 5 in solutions/scripts/delayed.js

View workflow job for this annotation

GitHub Actions / linting

'fetchPlaceholders' is defined but never used
getMetadata,
} from './lib-franklin.js';

// eslint-disable-next-line import/no-cycle
import {
getLanguageCountryFromPath,
// getLanguageCountryFromPath,
pushProductsToDataLayer,
pushToDataLayer,
getEnvironment,
// getEnvironment,
openUrlForOs,
} from './scripts.js';
import { loadBreadcrumbs } from './breadcrumbs.js';
Expand All @@ -20,21 +20,21 @@ import { onAdobeMcLoaded } from './utils.js';
// Core Web Vitals RUM collection
sampleRUM('cwv');

const LANGUAGE_COUNTRY = getLanguageCountryFromPath(window.location.pathname);
const LAUNCH_URL = 'https://assets.adobedtm.com';
const ENVIRONMENT = getEnvironment(window.location.hostname, LANGUAGE_COUNTRY.country);
// const LANGUAGE_COUNTRY = getLanguageCountryFromPath(window.location.pathname);
// const LAUNCH_URL = 'https://assets.adobedtm.com';
// const ENVIRONMENT = getEnvironment(window.location.hostname, LANGUAGE_COUNTRY.country);

// Load Adobe Experience platform data collection (Launch) script
const { launchProdScript, launchStageScript, launchDevScript } = await fetchPlaceholders();
// const { launchProdScript, launchStageScript, launchDevScript } = await fetchPlaceholders();

(async () => {
const ADOBE_MC_URL_ENV_MAP = new Map([
['prod', launchProdScript],
['stage', launchStageScript],
]);
// const ADOBE_MC_URL_ENV_MAP = new Map([
// ['prod', launchProdScript],
// ['stage', launchStageScript],
// ]);

const adobeMcScriptUrl = `${LAUNCH_URL}${ADOBE_MC_URL_ENV_MAP.get(ENVIRONMENT) || launchDevScript}`;
await loadScript(adobeMcScriptUrl);
// const adobeMcScriptUrl = `${LAUNCH_URL}${ADOBE_MC_URL_ENV_MAP.get(ENVIRONMENT) || launchDevScript}`;

Check failure on line 36 in solutions/scripts/delayed.js

View workflow job for this annotation

GitHub Actions / linting

This line has a length of 105. Maximum allowed is 100
// await loadScript(adobeMcScriptUrl);

onAdobeMcLoaded();
})();
Expand Down

0 comments on commit 9d882a6

Please sign in to comment.