[FIX] wesbite: update google analytics snippet according to google recommandation
This commit is contained in:
parent
007a2f2a24
commit
8286d4306a
|
@ -87,6 +87,19 @@
|
|||
<script type="text/javascript" src="/web/static/lib/bootstrap/js/bootstrap.js"></script>
|
||||
|
||||
<t t-raw="head or ''" name='layout_head'/>
|
||||
|
||||
<t t-if="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"/>'));
|
||||
ga('send','pageview');
|
||||
</script>
|
||||
|
||||
</t>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrapwrap">
|
||||
|
@ -202,17 +215,6 @@
|
|||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<t t-if="website.google_analytics_key">
|
||||
<script>
|
||||
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
|
||||
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
|
||||
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
|
||||
e.src='//www.google-analytics.com/analytics.js';
|
||||
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
|
||||
ga('create',_.str.trim('<t t-esc="website.google_analytics_key"/>'));
|
||||
ga('send','pageview');
|
||||
</script>
|
||||
</t>
|
||||
</body>
|
||||
</html>
|
||||
</template>
|
||||
|
@ -663,7 +665,6 @@
|
|||
<div class="oe_structure">
|
||||
<h1 class="container mt32"><t t-esc="status_code"/>: <t t-esc="status_message"/></h1>
|
||||
</div>
|
||||
|
||||
<div class="container" t-if="views">
|
||||
<div class="alert alert-danger" t-if="qweb_exception and editable">
|
||||
<h4>Template fallback</h4>
|
||||
|
|
Loading…
Reference in New Issue