From c8154c1fc2ed8840513b61172a6268fcccc60955 Mon Sep 17 00:00:00 2001 From: nilsding Date: Wed, 10 Dec 2014 19:54:27 +0100 Subject: [PATCH] added Piwik tracking --- app/views/layouts/application.html.haml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 9ff55266..9ac8adfb 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -19,3 +19,21 @@ .container %p.text-danger Debug params: = debug params + + - if Rails.env.production? + :javascript + var _paq = _paq || []; + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + _paq.push(['setCustomUrl', document.location]); + _paq.push(['setDocumentTitle', document.title]); + (function() { + var u="//stat.rrerr.net/"; + _paq.push(['setTrackerUrl', u+'piwik.php']); + _paq.push(['setSiteId', 9]); + 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+'piwik.js'; s.parentNode.insertBefore(g,s); + })(); + %noscript + %p + %img{:alt => "", :src => "//stat.rrerr.net/piwik.php?idsite=9", :style => "border:0;"}/ \ No newline at end of file