aboutsummaryrefslogtreecommitdiffstats
path: root/pelican-bootstrap3/templates/includes/piwik.html
blob: 70c45c2678b6cfc12678e181c5130d09182d52ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{% if PIWIK_SITE_ID and PIWIK_URL %}
    {% if PIWIK_SSL_URL is not defined %}
        {% set PIWIK_SSL_URL = PIWIK_URL %}
    {% endif %}
<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https://{{ PIWIK_SSL_URL }}/" : "http://{{ PIWIK_URL }}/");
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "{{ PIWIK_SITE_ID }}"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Piwik Code -->
{% endif %}