Skip to content

Commit

Permalink
TDW-2277 lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bosco-ensemble committed Apr 9, 2024
1 parent b179ce7 commit d225216
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ async function loadLazy(doc) {

window.setTimeout(async () => {
// eslint-disable-next-line no-use-before-define
await loadAds(doc);
await loadAds();
}, 1000);
}

Expand Down Expand Up @@ -1198,7 +1198,7 @@ async function OptanonWrapper() {
await sendAnalyticsPageEvent();
}

async function loadAds(doc) {
async function loadAds() {
const placeholders = await fetchPlaceholders();
const isProd = window.location.hostname.endsWith(placeholders.hostname);

Expand All @@ -1215,15 +1215,15 @@ async function loadAds(doc) {

const gtmId = placeholders.googletagmanagerId;
if (gtmId) {
const GTMScript = doc.createElement('script');
const GTMScript = document.createElement('script');
GTMScript.innerHTML = `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','${gtmId}');`;
document.head.append(GTMScript);

const GTMFrame = doc.createElement('no-script');
const GTMFrame = document.createElement('no-script');
GTMFrame.innerHTML = `<iframe src="https://www.googletagmanager.com/ns.html?id=${gtmId}"
height="0" width="0" style="display:none;visibility:hidden"></iframe>`;
document.body.prepend(GTMFrame);
Expand Down

0 comments on commit d225216

Please sign in to comment.