Add support for Piwik analytics
This commit is contained in:
parent
15ab888d0c
commit
3259bc7ede
3 changed files with 18 additions and 0 deletions
12
app/views/layouts/_piwik.html.erb
Normal file
12
app/views/layouts/_piwik.html.erb
Normal 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 -->
|
|
@ -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>
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue