Merge pull request #17 from esteinborn/patch-1
Update to Universal Google Analytics Script
This commit is contained in:
commit
6642ccef55
|
@ -1,16 +1,13 @@
|
||||||
{% if site.google_analytics %}
|
{% if site.google_analytics %}
|
||||||
<!-- Google Analytics -->
|
<!-- Google Analytics -->
|
||||||
<script type="text/javascript">
|
<script>
|
||||||
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
var _gaq = _gaq || [];
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
_gaq.push(['_setAccount', '{{ site.google_analytics }}']);
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
_gaq.push(['_trackPageview']);
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
(function() {
|
ga('create', '{{ site.google_analytics }}', 'auto');
|
||||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
ga('send', 'pageview');
|
||||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
|
||||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
|
||||||
})();
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
<!-- End Google Analytics -->
|
||||||
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue