Skip to content

Commit

Permalink
docs: add gtml
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoporto committed Nov 14, 2024
1 parent 74a4e74 commit 3ecb5d1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:

- name: Build app
run: npm run docs:build
env:
STORYBOOK_GTM_ID: ${{ vars.STORYBOOK_GTM_ID }}

- name: Setup Pages
uses: actions/configure-pages@v3
Expand Down
28 changes: 28 additions & 0 deletions .storybook/manager-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,31 @@
/>
<meta name="apple-mobile-web-app-title" content="SVG to Inline" />
<link rel="apple-touch-icon" href="images/touch/apple-touch-icon.png" />

<!-- Google Tag Manager -->
<script>
;(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', '%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 3ecb5d1

Please sign in to comment.