Add google analytics to data center light

This commit is contained in:
Andrii Marynets 2017-06-27 23:47:30 +03:00
commit 007fc794c3
5 changed files with 40 additions and 1 deletions

View file

@ -47,6 +47,9 @@
{% include "datacenterlight/includes/_footer.html" %}
<!-- Footer -->
<!-- Google analytics -->
{% include "datacenterlight/includes/_google_analytics.html" %}
<!-- jQuery -->
<script src="{% static 'datacenterlight/js/jquery.js' %}"></script>

View file

@ -0,0 +1,15 @@
<!-- Google Analytics -->
{% if GOOGLE_ANALYTICS_PROPERTY_ID %}
<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','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ GOOGLE_ANALYTICS_PROPERTY_ID }}', '{{ GOOGLE_ANALYTICS_DOMAIN }}');
ga('send', 'pageview');
</script>
{% else %}
<!-- Empty analytics -->
{% endif %}
<!-- End Google Analytics -->

View file

@ -2,7 +2,7 @@
{% load staticfiles bootstrap3 %}
{% load i18n %}
{% block content %}
{% include 'datacenterlight/includes/_google_analytics.html' %}
<div class="order-detail-container">
{% if messages %}
<div class="row">