Update Google Universal Analytics to load async (#2079)

This commit is contained in:
Christian Oliff 2019-03-06 08:56:03 +09:00 committed by Michael Rose
parent d5dae86319
commit bd5f157833

View file

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