Skip to content

Commit da0f160

Browse files
committed
fix google analytics
1 parent 901eac6 commit da0f160

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ url: "https://reqnroll.github.io" # the base hostname & protocol for your site,
1919
# twitter_username: jekyllrb
2020
github_username: reqnroll
2121
linkedin_username: reqnroll
22-
google_analytics: GT-K4CTF7X
22+
google_analytics: G-Y2KPXR5RYB
2323

2424
# Build settings
2525

_includes/google-analytics.html

Lines changed: 7 additions & 10 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-
}
11-
</script>
12-
8+
gtag('config', '{{ site.google_analytics }}');
9+
</script>

0 commit comments

Comments
 (0)