Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Improve google analytics template block

Michal Ociepka95e20d3c1d56
diff --git a/saleor/templates/base.html b/saleor/templates/base.html
index dd6beb7258..0106ec4019 100644
--- a/saleor/templates/base.html
+++ b/saleor/templates/base.html
@@ -117,12 +117,11 @@
{% block third-party-js %}
{% if GOOGLE_ANALYTICS_CODE %}
<script>
- {% block google-analytics-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');
-
+ {% block google-analytics-script %}
__ga('create', '{{ GOOGLE_ANALYTICS_CODE }}', '{{ CANONICAL_HOSTNAME }}');
__ga('send', 'pageview');
{% endblock google-analytics-script %}