Skip to content

Commit

Permalink
#15 - Add advanced configuration options for piwik analytics.
Browse files Browse the repository at this point in the history
  • Loading branch information
ruKurz committed Jun 11, 2017
1 parent 9c77df4 commit 89df55c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/rocketchat-analytics/client/trackEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ if (!window._paq || window.ga) {
if (window._paq) {
const http = location.protocol;
const slashes = http.concat('//');
const host = slashes.concat(window.location.hostname);
let host = slashes.concat(window.location.hostname);
if (RocketChat.settings.get('PiwikAnalytics_cookieDomain')) {
let parts = window.location.hostname.split('.');parts.shift();
let subDomains = parts.join('.');
host = slashes.concat(subDomains);
}
window._paq.push(['setCustomUrl', host + route.path]);
window._paq.push(['trackPageView']);
}
Expand Down

1 comment on commit 89df55c

@ruKurz
Copy link
Author

@ruKurz ruKurz commented on 89df55c Jun 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does:

//Trigger the trackPageView manually as the page views don't seem to be tracked

mean?

The reason for this dirty hack is that piwiki needs the upper level domain set as URL request param:
https://domain.tld

Please sign in to comment.