Skip to content

Commit

Permalink
docs: add GTM noscript tag
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoporto committed Nov 14, 2024
1 parent 9719bae commit f3273b2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .storybook/manager-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,17 @@
f.parentNode.insertBefore(j, f)
})(window, document, 'script', 'dataLayer', '%STORYBOOK_GTM_ID%')
</script>

<script>
document.addEventListener('DOMContentLoaded', function () {
var noScript = document.createElement('noscript')
var iframe = document.createElement('iframe')
iframe.src =
'https://www.googletagmanager.com/ns.html?id=%STORYBOOK_GTM_ID%'
iframe.height = '0'
iframe.width = '0'
iframe.style.cssText = 'display: none; visibility: hidden'
noScript.appendChild(iframe)
document.body.appendChild(noScript)
})
</script>

0 comments on commit f3273b2

Please sign in to comment.