Skip to content

Commit fb1fad1

Browse files
committed
Update google analytics load script
1 parent ceb2a74 commit fb1fad1

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

_layouts/default.html

+6-11
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,12 @@
77
{% if site.google_analytics %}
88
<!-- Asynchronous Google Analytics snippet -->
99
<script>
10-
var _gaq = _gaq || [];
11-
var pluginUrl =
12-
'//www.google-analytics.com/plugins/ga/inpage_linkid.js';
13-
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
14-
_gaq.push(['_setAccount', '{{ site.google_analytics }}']);
15-
_gaq.push(['_trackPageview']);
10+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
11+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
12+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
13+
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
1614

17-
(function() {
18-
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
19-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
20-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
21-
})();
15+
ga('create', '{{ site.google_analytics }}', 'auto');
16+
ga('send', 'pageview');
2217
</script>
2318
{% endif %}

0 commit comments

Comments
 (0)