{% if dbase.website.google.analytics.enable == true and dbase.website.google.analytics.id %}

  <script>

/*    var url_site  = "{{ site.url }}",
        url_production = "http://{{ site.host }}:{{ site.port }}";

    if (url_site != url_production) {*/

      (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', '{{ dbase.website.google.analytics.id }}', 'auto');
      ga('set', 'forceSSL', true);
      ga('send', 'pageview');

/*    };*/

  </script>

{% endif %}
{% if dbase.website.google.analytics.enable == true and dbase.website.google.analytics.id %}

  <script>

    var url_site  = "{{ site.url }}",
        url_production = "http://{{ site.host }}:{{ site.port }}";

    if (url_site != url_production) {
      (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', '{{ dbase.website.google.analytics.id }}', 'auto');
      ga('set', 'forceSSL', true);
      ga('send', 'pageview');
    };

  </script>

{% endif %}
Update - ter mai 9 18:44:50 -03 2017
Update - ter mai  9 18:44:50 -03 2017
