X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/fc0b706f8c7eb67531df0a2acd972412e47c7010..7e9be4e3962e1cccc43798d0507b2c82cd1d275c:/src/wolnelektury/templates/piwik/tracking_code.html?ds=inline diff --git a/src/wolnelektury/templates/piwik/tracking_code.html b/src/wolnelektury/templates/piwik/tracking_code.html index f09a5c6e5..2dd3f1145 100644 --- a/src/wolnelektury/templates/piwik/tracking_code.html +++ b/src/wolnelektury/templates/piwik/tracking_code.html @@ -1,15 +1,17 @@ - + - + var _paq = window._paq || []; + {% for slug, experiment in request.EXPERIMENTS.items %} + _paq.push(['setCustomVariable', '{{ forloop.counter }}', "{{ slug }}", "{{ experiment.value|yesno:"on,off," }}{{ experiment.manual|yesno:"-manual,," }}", "visit"]); + {% endfor %} + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (function() { + var u="{{ url }}"; + _paq.push(['setTrackerUrl', u+'matomo.php']); + _paq.push(['setSiteId', '{{ id }}']); + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); + })(); + +