Skip to content

Commit

Permalink
EDERCMS-5 Fix GTM debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
sippsolutions committed Oct 18, 2024
1 parent 98af710 commit d9bd3bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blocks/thirdparty/thirdparty.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ function initDataLayer(id) {
*/
function loadGoogleTagManager(id) {
const gtmUrl = `https://www.googletagmanager.com/gtag/js?id=${id}`;
if (hasUrlParam('gtm_debug')) {
if (hasUrlParam('gtm_debug') || sessionStorage.getItem('gtm_debug')) {
sessionStorage.setItem('gtm_debug', 1);
betterLoadScript(gtmUrl).then();
createScriptTag(null, initDataLayer.toString());
return Promise.resolve();
Expand Down

0 comments on commit d9bd3bd

Please sign in to comment.