Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/views/layouts/application.html.haml11
-rw-r--r--config/app_config.yml.example6
2 files changed, 17 insertions, 0 deletions
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 904909947..f7daf2a81 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -57,6 +57,17 @@
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
+ -if APP_CONFIG[:piwik_id]
+ :javascript
+ var pkBaseURL = (("https:" == document.location.protocol) ? "https://#{APP_CONFIG[:piwik_url]}/" : "http://#{APP_CONFIG[:piwik_url]}/");
+ document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
+ try {
+ var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", #{APP_CONFIG[:piwik_id]});
+ piwikTracker.trackPageView();
+ piwikTracker.enableLinkTracking();
+ } catch( err ) {}
+
+
- if current_user
%link{:rel => "alternate", :href => "#{current_user.public_url}", :type => "application/atom+xml", :title => "Public Diaspora Feed for #{current_user.real_name}"}
diff --git a/config/app_config.yml.example b/config/app_config.yml.example
index 06b6c3168..3aef91197 100644
--- a/config/app_config.yml.example
+++ b/config/app_config.yml.example
@@ -68,6 +68,12 @@ default:
#google analytics key, if false, it won't include the javascript
google_a_site: false
+
+ #piwik integration if not set, no javascript included
+ piwik_id:
+ # the site url in raw format (e.g. pikwik.examplehost.com)
+ piwik_url:
+
#cloudfiles username and api-key, used for backups
cloudfiles_username: 'example'