Skip to content

Commit

Permalink
Merge pull request #65 from hlxsites/feature/gtm-onetrust-cookie
Browse files Browse the repository at this point in the history
Feature/gtm onetrust cookie
  • Loading branch information
davenichols-DHLS authored Oct 31, 2023
2 parents 5f8e838 + 755cf27 commit 0557d7c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/delayed.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sampleRUM('cwv');
function loadGTM() {
const scriptTag = document.createElement('script');
scriptTag.innerHTML = `
let gtmId = 'GTM-MLWV3QQ';
let gtmId = 'GTM-W93WJWB9';
// googleTagManager
(function (w, d, s, l, i) {
w[l] = w[l] || [];
Expand All @@ -26,6 +26,12 @@ function loadGTM() {
})(window, document, 'script', 'dataLayer', gtmId);
`;
document.head.prepend(scriptTag);
const noScriptTag = document.createElement('noscript');
noScriptTag.innerHTML = `
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W93WJWB9"
height="0" width="0" style="display:none;visibility:hidden"></iframe>
`;
document.body.prepend(noScriptTag);
}
// google tag manager -end

Expand Down

0 comments on commit 0557d7c

Please sign in to comment.