Skip to content

Commit bd5f157

Browse files
coliffmmistakes
authored andcommittedMar 5, 2019
Update Google Universal Analytics to load async (mmistakes#2079)
1 parent d5dae86 commit bd5f157

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
<script>
2-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
3-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
4-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
5-
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
6-
7-
ga('create', '{{ site.analytics.google.tracking_id }}', 'auto');
8-
ga('set', 'anonymizeIp', {{ site.analytics.google.anonymize_ip | default: false }})
9-
ga('send', 'pageview');
2+
window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;
3+
ga('create','{{ site.analytics.google.tracking_id }}','auto');
4+
ga('set', 'anonymizeIp', {{ site.analytics.google.anonymize_ip | default: false }});
5+
ga('send','pageview')
106
</script>
7+
<script src="https://www.google-analytics.com/analytics.js" async></script>

0 commit comments

Comments
 (0)
Please sign in to comment.