Skip to content

Commit 494ffef

Browse files
Copilotbrunoborges
andcommitted
Add Google Analytics to all HTML pages via templates
Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
1 parent 13813a2 commit 494ffef

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

templates/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,16 @@
150150
}
151151
}
152152
</script>
153+
154+
<!-- Google tag (gtag.js) -->
155+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-HL8F2RJW68"></script>
156+
<script>
157+
window.dataLayer = window.dataLayer || [];
158+
function gtag(){dataLayer.push(arguments);}
159+
gtag('js', new Date());
160+
161+
gtag('config', 'G-HL8F2RJW68');
162+
</script>
153163
</head>
154164
<body data-page="home">
155165
<nav>

templates/slug-template.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@
7474
]
7575
}
7676
</script>
77+
78+
<!-- Google tag (gtag.js) -->
79+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-HL8F2RJW68"></script>
80+
<script>
81+
window.dataLayer = window.dataLayer || [];
82+
function gtag(){dataLayer.push(arguments);}
83+
gtag('js', new Date());
84+
85+
gtag('config', 'G-HL8F2RJW68');
86+
</script>
7787
</head>
7888
<body data-page="single">
7989
<nav>

0 commit comments

Comments
 (0)