From f0c6139803e3153ed524810606cd91a922779fa5 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 13 Jul 2020 17:40:41 +0100 Subject: [PATCH] Update analytics host tracking for new structure --- src/Analytics.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Analytics.js b/src/Analytics.js index 59cc9d0872..adaf21e2a1 100644 --- a/src/Analytics.js +++ b/src/Analytics.js @@ -204,8 +204,11 @@ class Analytics { this._setVisitVariable('Chosen Language', getCurrentLanguage()); - if (window.location.hostname === 'riot.im') { + const hostname = window.location.hostname; + if (hostname === 'riot.im') { this._setVisitVariable('Instance', window.location.pathname); + } else if (hostname.endsWith('.element.io')) { + this._setVisitVariable('Instance', hostname); } let installedPWA = "unknown";