From 3e7ef112f02f1abec561d3e8a3dc29b68cc90ab4 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 29 May 2017 13:17:12 +0100 Subject: [PATCH] opt out based on analyticsOptOut localSetting Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vector/index.js b/src/vector/index.js index 7674dd4789..571fecfa42 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -280,8 +280,8 @@ async function loadApp() { } else if (validBrowser) { UpdateChecker.start(); - const doNotTrack = navigator.doNotTrack === 'yes' || navigator.doNotTrack === '1' || navigator.doNotTrack === 1; - if (!doNotTrack && configJson.piwik && configJson.piwik.url && configJson.piwik.siteId) { + const analyticsEnabled = !UserSettingsStore.getLocalSetting('analyticsOptOut', false); + if (analyticsEnabled && configJson.piwik && configJson.piwik.url && configJson.piwik.siteId) { (function() { const g = document.createElement('script'); const s = document.getElementsByTagName('script')[0];