Skip to content

Commit 5ca7709

Browse files
committed
✨ feat(docs): update Google Tag Manager implementation
- replace old GTM script with new Google tag (gtag.js) for improved tracking - remove noscript iframe for cleaner HTML structure
1 parent ec80dd4 commit 5ca7709

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

docs/_layouts/default.html

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
<head>
44
<meta charset="utf-8">
55
<!-- Google Tag Manager -->
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-44XG57BE28"></script>
68
<script>
7-
(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','GTM-WRVT65');</script>
9+
window.dataLayer = window.dataLayer || [];
10+
function gtag(){dataLayer.push(arguments);}
11+
gtag('js', new Date());
12+
13+
gtag('config', 'G-44XG57BE28');
14+
</script>
1215
<!-- End Google Tag Manager -->
1316
{% seo %}
1417
<link rel="canonical" href="{{site.cannonicalBase}}{{page.url}}" />
@@ -20,11 +23,6 @@
2023
<link href="{{site.baseurl}}/assets/css/base16.css" rel="stylesheet" />
2124
</head>
2225
<body>
23-
<!-- Google Tag Manager (noscript) -->
24-
<noscript>
25-
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WRVT65"
26-
height="0" width="0" style="display:none;visibility:hidden"></iframe>
27-
</noscript>
2826
<!-- End Google Tag Manager (noscript) -->
2927
{%- include header.html -%}
3028
<div class="mainContainer">

0 commit comments

Comments
 (0)