зеркало из https://github.com/mozilla/bedrock.git
Detect UITour failure / non-response on what's new page (Fixes #7671)
This commit is contained in:
Родитель
0ac322232a
Коммит
8a224ce9da
|
@ -5,6 +5,27 @@
|
|||
(function() {
|
||||
'use strict';
|
||||
|
||||
// Issue #7671 measure potential UITour failure for bug 1557153
|
||||
function pingUITour() {
|
||||
var startTime = performance.now();
|
||||
var timeout = window.setTimeout(trackImpression, 1000, 'UITour Timeout');
|
||||
|
||||
Mozilla.UITour.ping(function() {
|
||||
window.clearTimeout(timeout);
|
||||
trackImpression('UITour Response');
|
||||
});
|
||||
|
||||
function trackImpression(eLabel) {
|
||||
var endTime = performance.now() - startTime;
|
||||
|
||||
window.dataLayer.push({
|
||||
'eLabel': eLabel,
|
||||
'data-response-time': endTime,
|
||||
'event': 'non-interaction'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent double-requesting Flow IDs. Inits signed out button even on non-firefox browsers (highly unlikely on this page, but you never know).
|
||||
if (Mozilla.Client.isFirefoxDesktop) {
|
||||
Mozilla.Client.getFxaDetails(function(details) {
|
||||
|
@ -17,4 +38,6 @@
|
|||
} else {
|
||||
Mozilla.MonitorButton.init('monitor-button-signed-out');
|
||||
}
|
||||
|
||||
pingUITour();
|
||||
})();
|
||||
|
|
Загрузка…
Ссылка в новой задаче