From 16aa7983edefe2ac4c1f4f2b49634f91dbb2bad7 Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Wed, 9 Aug 2017 16:44:09 -0700 Subject: [PATCH] added missing exit event cases --- frontend/src/metrics.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/metrics.js b/frontend/src/metrics.js index c7dff67d..594d6784 100644 --- a/frontend/src/metrics.js +++ b/frontend/src/metrics.js @@ -41,6 +41,11 @@ function urlToMetric(url) { return 'twitter'; case 'https://www.mozilla.org/firefox/new/?scene=2': return 'download-firefox'; + case 'https://qsurvey.mozilla.com/s3/txp-firefox-send': + return 'survey'; + case 'https://testpilot.firefox.com/': + case 'https://testpilot.firefox.com/experiments/send': + return 'testpilot'; default: return 'other'; } @@ -198,7 +203,7 @@ function exitEvent(target) { function addExitHandlers() { const links = Array.from(document.querySelectorAll('a')); links.forEach(l => { - if (/^http/.test(l.href)) { + if (/^http/.test(l.getAttribute('href'))) { l.addEventListener('click', exitEvent); } });