added support for tracking via piwik.
if piwik_id is not set no javascript will be included. it may be both enabled, aganalytics and piwik.
This commit is contained in:
parent
2c22941e2f
commit
35feccbb2c
2 changed files with 17 additions and 0 deletions
|
|
@ -57,6 +57,17 @@
|
||||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
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
|
- if current_user
|
||||||
%link{:rel => "alternate", :href => "#{current_user.public_url}", :type => "application/atom+xml", :title => "Public Diaspora Feed for #{current_user.real_name}"}
|
%link{:rel => "alternate", :href => "#{current_user.public_url}", :type => "application/atom+xml", :title => "Public Diaspora Feed for #{current_user.real_name}"}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,12 @@ default:
|
||||||
|
|
||||||
#google analytics key, if false, it won't include the javascript
|
#google analytics key, if false, it won't include the javascript
|
||||||
google_a_site: false
|
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 and api-key, used for backups
|
||||||
cloudfiles_username: 'example'
|
cloudfiles_username: 'example'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue