[FIX] move google analytics js snippet at the bottom (Fixes #3222)

This commit is contained in:
Fabien Meghazi 2014-10-21 17:14:23 +02:00
parent a39073db91
commit aabec55125
1 changed files with 9 additions and 11 deletions

View File

@ -92,17 +92,6 @@
<t t-call-assets="website.assets_frontend" t-js="false"/>
<t t-raw="head or ''" name='layout_head'/>
<t t-if="website and website.google_analytics_key">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', _.str.trim('<t t-esc="website.google_analytics_key"/>'), 'auto');
ga('send','pageview');
</script>
</t>
</head>
<body>
<div id="wrapwrap">
@ -153,6 +142,15 @@
<t t-call-assets="web.assets_common" t-css="false"/>
<t t-call-assets="website.assets_frontend" t-css="false"/>
<script t-if="website and website.google_analytics_key">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', _.str.trim('<t t-esc="website.google_analytics_key"/>'), 'auto');
ga('send','pageview');
</script>
</body>
</html>
</template>