Skip to content

Commit 52c8869

Browse files
committed
✨ feat(docs): integrate Google Tag Manager
- update googleTagId in hugo.yaml for accurate tracking - replace gtag.js with Google Tag Manager script for enhanced functionality
1 parent c67efff commit 52c8869

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

docs/hugo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ params:
3232
supportEmail: "[email protected]"
3333
githubUrl: "https://github.com/nkdAgility/azure-devops-migration-tools"
3434
editPage: "https://github.com/nkdAgility/azure-devops-migration-tools/tree/main/docs/content/"
35-
googleTagId: "G-R0NEH3XJNF"
35+
googleTagId: "GTM-TZT4HG96" # GTM-TZT4HG23
3636
version: "#{GitVersion.SemVer}#"
3737
ring: "#{ToolsTemplates_AzureSitesConfig}#"
3838
downloadUrl: "/download"

docs/layouts/baseof.html

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<!-- Google Tag Manager -->
7-
<!-- Google tag (gtag.js) -->
8-
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.Params.googleTagId }}"></script>
9-
<script>
10-
window.dataLayer = window.dataLayer || [];
11-
function gtag() {
12-
dataLayer.push(arguments);
13-
}
14-
gtag("js", new Date());
15-
16-
gtag("config", "{{ .Site.Params.googleTagId }}");
17-
</script>
7+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
8+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
9+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
10+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
11+
})(window,document,'script','dataLayer','{{ .Site.Params.googleTagId }}');</script>
1812
<!-- End Google Tag Manager -->
1913
<title>{{ .Title }} | {{ .Site.Title }}</title>
2014
<link rel="icon" href="{{ .Site.Params.favicon | default "/favicon.ico" }}" type="image/x-icon" />
@@ -34,7 +28,10 @@
3428
</head>
3529

3630
<body id="top" data-ndka-environment="{{ hugo.Environment }}" data-ndka-version="{{ .Site.Params.version | default "v0.0.0" }}">
37-
<!-- Setting theme here to avoid FOUC -->
31+
<!-- Google Tag Manager (noscript) -->
32+
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ .Site.Params.googleTagId }}"
33+
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
34+
<!-- End Google Tag Manager (noscript) -->
3835

3936
{{ if ne hugo.Environment "production" }}
4037
<div class="container-fluid text-center p-2 bg-{{ hugo.Environment }}">

0 commit comments

Comments
 (0)