Skip to content

Commit 97c42ab

Browse files
Merge pull request #36 from WeAllJS/fix-GA-setup
Replaced GA script tag with updated version
2 parents 6a45ea6 + a79e01b commit 97c42ab

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

_includes/scripts.html

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,18 @@
8282
{% if site.google_analytics %}
8383
<!-- Asynchronous Google Analytics snippet -->
8484
<script>
85-
var _gaq = _gaq || [];
86-
var pluginUrl =
87-
'//www.google-analytics.com/plugins/ga/inpage_linkid.js';
88-
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
89-
_gaq.push(['_setAccount', '{{ site.google_analytics }}']);
90-
_gaq.push(['_trackPageview']);
91-
92-
(function() {
93-
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
94-
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
95-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
96-
})();
85+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
86+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
87+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
88+
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
89+
90+
ga('create', '{{ site.google_analytics }}', 'auto');
91+
ga('send', 'pageview');
9792
</script>
98-
{% endif %}
93+
94+
95+
{% endif %}
9996

10097
{% if page.comments %}
10198
{% include disqus_comments.html %}
102-
{% endif %}
99+
{% endif %}

0 commit comments

Comments
 (0)