bring back analytics logic in layout template
This commit is contained in:
parent
edf0085055
commit
12e78e95ec
@ -51,9 +51,7 @@
|
||||
#}
|
||||
{% block footer %}
|
||||
{%- if google_analytics_key -%}
|
||||
{# FIXME VFE bring back old logic, it cannot be specified in a js file. #}
|
||||
<script type="text/javascript"
|
||||
src="{{ pathto('_static/js/google_analytics.js', 1) }}"></script>
|
||||
{% include "layout_templates/google_analytics.html" %}
|
||||
{%- endif -%}
|
||||
{% endblock %}
|
||||
|
||||
|
10
extensions/odoo_theme/layout_templates/google_analytics.html
Normal file
10
extensions/odoo_theme/layout_templates/google_analytics.html
Normal file
@ -0,0 +1,10 @@
|
||||
<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', '{{ google_analytics_key }}', 'auto');
|
||||
ga('set', 'anonymizeIp', true);
|
||||
ga('send','pageview');
|
||||
</script>
|
@ -1,9 +0,0 @@
|
||||
(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');
|
||||
|
||||
// VFE FIXME, the {{}} is jinja code, it cannot be moved in an independent js code :P
|
||||
ga('create', '{{ google_analytics_key }}', 'auto');
|
||||
ga('set', 'anonymizeIp', true);
|
||||
ga('send','pageview');
|
Loading…
Reference in New Issue
Block a user