{% if site.gauges_id %}
  <!-- Gauges (http://gaug.es/) -->
  <script type="text/javascript">
    var _gauges = _gauges || [];
    (function() {
      var t   = document.createElement('script');
      t.type  = 'text/javascript';
      t.async = true;
      t.id    = 'gauges-tracker';
      t.setAttribute('data-site-id', '{{ site.gauges_id }}');
      t.src = '//secure.gaug.es/track.js';
      var s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(t, s);
    })();
  </script>
{% endif %}

{% if site.google_analytics_id %}
  <!-- Google Analytics (http://google.com/analytics) -->
  <script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', '{{ site.google_analytics_id }}']);
    _gaq.push(['_setDomainName', '{{ site.url }}']); // Multiple sub-domains
    _gaq.push(['_setAllowLinker', true]); // Multiple TLDs
    _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 %}
