mirror of
https://github.com/MinimalBible/MinimalBible.github.io
synced 2024-12-30 10:38:45 -05:00
Upgrade Google analytics to Google universal analytics
Google will deprecate old ga.js. Change to new analytics.js, and also use the new version of the enhanced link attribution module.
This commit is contained in:
parent
83882180ae
commit
9f81ac8bec
@ -4,18 +4,14 @@
|
|||||||
{% if site.google_analytics %}
|
{% if site.google_analytics %}
|
||||||
<!-- Asynchronous Google Analytics snippet -->
|
<!-- Asynchronous Google Analytics snippet -->
|
||||||
<script>
|
<script>
|
||||||
var _gaq = _gaq || [];
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
var pluginUrl =
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
'//www.google-analytics.com/plugins/ga/inpage_linkid.js';
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
_gaq.push(['_setAccount', '{{ site.google_analytics }}']);
|
|
||||||
_gaq.push(['_trackPageview']);
|
|
||||||
|
|
||||||
(function() {
|
ga('create', '{{ site.google_analytics }}', 'auto');
|
||||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
ga('require', 'linkid', 'linkid.js');
|
||||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
ga('send', 'pageview');
|
||||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
|
||||||
})();
|
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if page.comments %}{% include disqus_comments.html %}{% endif %}
|
{% if page.comments %}{% include disqus_comments.html %}{% endif %}
|
Loading…
Reference in New Issue
Block a user