Add support for Piwik analytics

This commit is contained in:
Tom Hughes 2011-09-17 00:11:53 +01:00
parent 15ab888d0c
commit 3259bc7ede
3 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,12 @@
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://<%= PIWIK_LOCATION %>/" : "http://<%= PIWIK_LOCATION %>/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", <%= PIWIK_SITE %>);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://<%= PIWIK_LOCATION %>/piwik.php?idsite=<%= PIWIK_SITE %>" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->

View file

@ -133,5 +133,8 @@
</div> </div>
</center> </center>
</div> </div>
<% if defined?(PIWIK_LOCATION) and defined?(PIWIK_SITE) -%>
<%= render :partial => "layouts/piwik" %>
<% end -%>
</body> </body>
</html> </html>

View file

@ -73,6 +73,9 @@ standard_settings: &standard_settings
require_terms_seen: false require_terms_seen: false
# Whether to require users to agree to the CTs before editing # Whether to require users to agree to the CTs before editing
require_terms_agreed: false require_terms_agreed: false
# Piwik details
#piwik_location: "piwik.openstreetmap.org"
#piwik_site: 1
development: development:
<<: *standard_settings <<: *standard_settings