first version of the new website
[markerbeacon.git] / themes / markerbeacon / templates / analytics.html
1 {% if GOOGLE_ANALYTICS %}
2     <script type="text/javascript">
3     (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4     (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
5     m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
6     })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
7
8     ga('create', '{{GOOGLE_ANALYTICS}}', '{{GA_COOKIE_DOMAIN if GA_COOKIE_DOMAIN else 'auto'}}');
9     ga('send', 'pageview');
10     </script>
11 {% endif %}
12 {% if GAUGES %}
13     <script type="text/javascript">
14     var _gauges = _gauges || [];
15     (function() {
16         var t   = document.createElement('script');
17         t.type  = 'text/javascript';
18         t.async = true;
19         t.id    = 'gauges-tracker';
20         t.setAttribute('data-site-id', '{{GAUGES}}');
21         t.src = '//secure.gaug.es/track.js';
22         var s = document.getElementsByTagName('script')[0];
23         s.parentNode.insertBefore(t, s);
24     })();
25     </script>
26 {% endif %}