Skip to content

Commit 35815d0

Browse files
authored
Update analytics.html
1 parent 1b3f313 commit 35815d0

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

_includes/analytics.html

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

9-
ga('create', '{{ site.google_analytics }}', 'auto');
10-
ga('send', 'pageview', {
11-
'page': '{{ site.baseurl }}{{ page.url }}',
12-
'title': '{{ page.title | replace: "'", "\\'" }}'
13-
});
9+
gtag('config', 'G-R9S1R9LV9P');
1410
</script>
1511
<!-- End Google Analytics -->
1612
{% endif %}

0 commit comments

Comments
 (0)