Skip to content

Commit 6642cce

Browse files
committed
Merge pull request barryclark#17 from esteinborn/patch-1
Update to Universal Google Analytics Script
2 parents 36b4c9b + 14f665d commit 6642cce

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

_includes/analytics.html

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
{% if site.google_analytics %}
22
<!-- Google Analytics -->
3-
<script type="text/javascript">
4-
5-
var _gaq = _gaq || [];
6-
_gaq.push(['_setAccount', '{{ site.google_analytics }}']);
7-
_gaq.push(['_trackPageview']);
8-
9-
(function() {
10-
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
11-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
12-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
13-
})();
14-
3+
<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');
8+
9+
ga('create', '{{ site.google_analytics }}', 'auto');
10+
ga('send', 'pageview');
1511
</script>
16-
{% endif %}
12+
<!-- End Google Analytics -->
13+
{% endif %}

0 commit comments

Comments
 (0)