Skip to content

Commit 593a05a

Browse files
authored
Update google-analytics.html (#824)
Merge pull request 824
1 parent fefbe67 commit 593a05a

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

_includes/google-analytics.html

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1+
<!-- Google tag (gtag.js) -->
2+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
13
<script>
2-
if(!(window.doNotTrack === "1" || navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1")) {
3-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
5-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
6-
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
4+
window.dataLayer = window.dataLayer || [];
5+
function gtag(){dataLayer.push(arguments);}
6+
gtag('js', new Date());
77

8-
ga('create', '{{ site.google_analytics }}', 'auto');
9-
ga('send', 'pageview');
10-
}
8+
gtag('config', '{{ site.google_analytics }}');
119
</script>
12-

0 commit comments

Comments
 (0)