Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Commit

Permalink
enable piwik analytics for owums site
Browse files Browse the repository at this point in the history
  • Loading branch information
idemarinis committed Mar 11, 2015
1 parent 9e1d225 commit 91813f7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
15 changes: 14 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,19 @@
</div>
<div class="clear"></div>
</div>

<% if CONFIG['piwik_url'] and CONFIG['piwik_site_id'] %>
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u=<%= CONFIG['piwik_url'] %>;
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', <%= CONFIG['piwik_site_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+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<% end %>
</body>
</html>
4 changes: 2 additions & 2 deletions config/backgroundrb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
# but you still want to be able to trace from which Access Point users connected
# this feature depends on OpenWISP MiddleWare 0.0.7
# OWMW must be enabled how described in the README file
#:convert_radius_accountings:
# :trigger_args: 0 */5 * * * *
:convert_radius_accountings:
:trigger_args: 0 */5 * * * *
5 changes: 4 additions & 1 deletion config/config.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ defaults: &defaults
german: true
slovenian: false
furlan: false

#piwik_site_id: idsite
#piwik_url: //piwiki-url.com

# uncomment these if you deploy your app in a sub directory
# app root dir and static assets host
Expand All @@ -36,4 +39,4 @@ development:
<<: *defaults

test:
<<: *defaults
<<: *defaults

0 comments on commit 91813f7

Please sign in to comment.