Przeglądaj źródła

Adds analytics code from NotMyIdea theme

Talha Mansoor 12 lat temu
rodzic
commit
cffd9a685b
2 zmienionych plików z 13 dodań i 0 usunięć
  1. 12 0
      templates/analytics.html
  2. 1 0
      templates/base.html

+ 12 - 0
templates/analytics.html

@@ -0,0 +1,12 @@
+{% if GOOGLE_ANALYTICS %}
+    <script type="text/javascript">
+    var _gaq = _gaq || [];
+    _gaq.push(['_setAccount', '{{GOOGLE_ANALYTICS}}']);
+    _gaq.push(['_trackPageview']);
+    (function() {
+        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+    })();
+    </script>
+{% endif %}

+ 1 - 0
templates/base.html

@@ -49,6 +49,7 @@
             </div>
         </div>
         {% block script %}
+        {% include 'analytics.html' %}
         <script src="http://code.jquery.com/jquery.js"></script>
         <script src="{{ SITEURL }}/theme/js/bootstrap.min.js"></script>
         {% endblock script %}