Skip to content

Commit 41237e9

Browse files
authored
Update default.html
1 parent 448bf4c commit 41237e9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

_layouts/default.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,14 @@ <h1><a href="{{ "/" | absolute_url }}">{{ site.title | default: site.github.repo
5353
</div>
5454
<script src="{{ "/assets/js/scale.fix.js" | relative_url }}"></script>
5555
{% if site.google_analytics %}
56+
<!-- Google tag (gtag.js) -->
57+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PVLY0GT4YT"></script>
5658
<script>
57-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
58-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
59-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
60-
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
61-
ga('create', '{{ site.google_analytics }}', 'auto');
62-
ga('send', 'pageview');
59+
window.dataLayer = window.dataLayer || [];
60+
function gtag(){dataLayer.push(arguments);}
61+
gtag('js', new Date());
62+
63+
gtag('config', 'G-PVLY0GT4YT');
6364
</script>
6465
{% endif %}
6566
</body>

0 commit comments

Comments
 (0)