Permalink
Browse files

Add analytics and metrika

  • Loading branch information...
1 parent bf25923 commit f8bed4f30a8b213ff6b1a7c9424941044258e225 @klen committed Oct 2, 2012
@@ -17,16 +17,17 @@
{% block body_content %}
{# Navbar #}
- {% block navigation %}
- {% include 'core/blocks/nav.html' %}
- {% endblock %}
+ {% block navigation %}{% include 'core/blocks/nav.html' %}{% endblock %}
- {% include "core/blocks/messages.html" %}
+ {# Messages #}
+ {% block messages %}{% include "core/blocks/messages.html" %}{% endblock %}
+ {# Content #}
<div class="container">
{% block page_content %}{% endblock %}
</div>
+ {# Footer #}
{% block footer %}
<style type="text/css" media="screen">
.footer {
@@ -42,4 +43,7 @@
</footer>
{% endblock %}
+ {% if config.get('FOUNDATION_METRIKA') %} {% include "core/blocks/metrika.html" %} {% endif %}
+ {% if config.get('FOUNDATION_ANALYTICS') %} {% include "core/blocks/analytics.html" %} {% endif %}
+
{% endblock %}
@@ -0,0 +1,11 @@
+<script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', "{{ config['FOUNDATION_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>
@@ -0,0 +1,23 @@
+<!-- Yandex.Metrika counter -->
+<script type="text/javascript">
+(function (d, w, c) {
+ (w[c] = w[c] || []).push(function() {
+ try {
+ w.yaCounter{{ config.get('FOUNDATION_METRIKA') }} = new Ya.Metrika({id:{{ config.get('FOUNDATION_METRIKA') }}, enableAll: true});
+ } catch(e) { }
+ });
+
+ var n = d.getElementsByTagName("script")[0],
+ s = d.createElement("script"),
+ f = function () { n.parentNode.insertBefore(s, n); };
+ s.type = "text/javascript";
+ s.async = true;
+ s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
+
+ if (w.opera == "[object Opera]") {
+ d.addEventListener("DOMContentLoaded", f);
+ } else { f(); }
+})(document, window, "yandex_metrika_callbacks");
+</script>
+<noscript><div><img src="//mc.yandex.ru/watch/{{ config.get('FOUNDATION_METRIKA') }}" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
+<!-- /Yandex.Metrika counter -->

0 comments on commit f8bed4f

Please sign in to comment.