From 72b4aa969eb02135e64ffccea3d0f101011e4c6a Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 23 Sep 2013 22:49:44 +0000 Subject: [PATCH] * VRFS-709 - Audio Qualication instrumented --- web/app/assets/javascripts/ftue.js | 7 ++++++- web/app/assets/javascripts/ga.js | 14 +++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/web/app/assets/javascripts/ftue.js b/web/app/assets/javascripts/ftue.js index 05b60012b..a9d8776d7 100644 --- a/web/app/assets/javascripts/ftue.js +++ b/web/app/assets/javascripts/ftue.js @@ -105,7 +105,8 @@ function testComplete() { logger.debug("Test complete"); var latencyMS = context.JK.FtueWizard.latencyMS; - if (latencyMS <= 20) { + var ftueSucceeded = latencyMS <= 20; + if (ftueSucceeded) { logger.debug(latencyMS + " is <= 20. Setting FTUE status to true"); ftueSave(true); // Save the profile context.jamClient.FTUESetStatus(true); // No FTUE wizard next time @@ -113,6 +114,10 @@ // notify anyone curious about how it went $('div[layout-id=ftue]').trigger('ftue_success'); } + + // notify GA of the success + context.JK.GA.trackFTUECompletion(ftueSucceeded, context.JK.detectOS()); + updateGauge(); } diff --git a/web/app/assets/javascripts/ga.js b/web/app/assets/javascripts/ga.js index 787504be2..46e05a8c7 100644 --- a/web/app/assets/javascripts/ga.js +++ b/web/app/assets/javascripts/ga.js @@ -16,7 +16,9 @@ var categories = { register : "Register", - download : "DownloadClient" + download : "DownloadClient", + audioTest : "AudioTest" + } function translatePlatformForGA(platform) { @@ -67,9 +69,19 @@ ga('send', 'event', categories.download, normalizedPlatform); } + function trackFTUECompletion(success, platform) { + assertBoolean(success); + var normalizedPlatform = translatePlatformForGA(platform); + + var status = success ? "Passed" : "Failed"; + + ga('send', 'event', categories.audioTest, status, normalizedPlatform); + } + var GA = {}; GA.trackRegister = trackRegister; GA.trackDownload = trackDownload; + GA.trackFTUECompletion = trackFTUECompletion; context.JK.GA = GA;