Skip to content

Commit

Permalink
Merge pull request #71 from cncf/gtm
Browse files Browse the repository at this point in the history
Installs GTM instead of just GA4
  • Loading branch information
cjyabraham committed Jan 17, 2024
2 parents 02c4483 + 1823061 commit 9877fa5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
6 changes: 6 additions & 0 deletions website/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
{{ partial "head.html" . }}
</head>
<body class="td-{{ .Kind }}">
{{ if hugo.IsProduction }}
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WJJ7VKZ"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{{ end }}
<header>
{{ partial "navbar.html" . }}
</header>
Expand Down
16 changes: 7 additions & 9 deletions website/layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
<script src="https://cmp.osano.com/16A0DbT9yDNIaQkvZ/c3494b1e-ff3a-436f-978d-842e9a0bed27/osano.js"></script>

{{ if hugo.IsProduction }}
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-T6VMPWFRDW"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-T6VMPWFRDW');
</script>
<!-- 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','GTM-WJJ7VKZ');</script>
<!-- End Google Tag Manager -->

{{ end }}
{{ partialCached "head-css.html" . "asdf" }}
Expand Down

0 comments on commit 9877fa5

Please sign in to comment.