X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/3259bc7edecbcfc54eb70e3c0a1e07d6b582a46c..365163929d32b820f3c5d0b639efd26479690638:/app/views/layouts/_piwik.html.erb
diff --git a/app/views/layouts/_piwik.html.erb b/app/views/layouts/_piwik.html.erb
index 59017e0b7..0ba307437 100644
--- a/app/views/layouts/_piwik.html.erb
+++ b/app/views/layouts/_piwik.html.erb
@@ -1,12 +1,14 @@
-
-
+var _paq = _paq || [];
+(function(){ var u="<%= request.protocol %><%= PIWIK_LOCATION %>/";
+_paq.push(['setSiteId', <%= PIWIK_SITE %>]);
+_paq.push(['setTrackerUrl', u+'piwik.php']);
+_paq.push(['trackPageView']);
+_paq.push(['enableLinkTracking']);
+<% if flash[:piwik_goal] -%>
+_paq.push(['setSiteId', <%= flash[:piwik_goal] %>);
+<% end -%>
+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); })();
+
+