From 88f94f8a8f7a2ba18a749cf0b3882f90c532da13 Mon Sep 17 00:00:00 2001 From: "Mike P. Sinn" Date: Tue, 26 May 2020 15:49:38 -0500 Subject: [PATCH] Logrocket --- .idea/dictionaries/m.xml | 1 + src/js/qmHelpers.js | 39 +++++++++++++++++++++------------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/.idea/dictionaries/m.xml b/.idea/dictionaries/m.xml index bdbc0fbe43..616e93aa4e 100644 --- a/.idea/dictionaries/m.xml +++ b/.idea/dictionaries/m.xml @@ -62,6 +62,7 @@ lazypipe ldflags localforage + logrocket mikepsinn mindfirst minifying diff --git a/src/js/qmHelpers.js b/src/js/qmHelpers.js index 3ad7635806..32263b694f 100644 --- a/src/js/qmHelpers.js +++ b/src/js/qmHelpers.js @@ -9002,25 +9002,28 @@ var qm = { name: user.displayName, }) } - if(typeof LogRocket !== "undefined" && qm.appMode.isProduction()){ - LogRocket.init('zi2x4l/quantimodo'); - LogRocket.identify(user.id, { - name: user.displayName, - email: user.email, - upgraded: user.stripeActive, - // Add your own custom user variables here, ie: - subscriptionType: 'pro' - }); - if(typeof drift !== "undefined"){ - LogRocket.getSessionURL(function(sessionURL){ - drift.track('LogRocket', {sessionURL: sessionURL}); + if(typeof LogRocket !== "undefined"){ + var record = qm.appMode.isProduction() || qm.urlHelper.getParam('logrocket'); + if(record){ + LogRocket.init('zi2x4l/quantimodo'); + LogRocket.identify(user.id, { + name: user.displayName, + email: user.email, + upgraded: user.stripeActive, + // Add your own custom user variables here, ie: + subscriptionType: 'pro' }); - } - if(typeof Bugsnag !== "undefined"){ - Bugsnag.beforeNotify = function(data){ - data.metaData.sessionURL = LogRocket.sessionURL; - return data; - }; + if(typeof drift !== "undefined"){ + LogRocket.getSessionURL(function(sessionURL){ + drift.track('LogRocket', {sessionURL: sessionURL}); + }); + } + if(typeof Bugsnag !== "undefined"){ + Bugsnag.beforeNotify = function(data){ + data.metaData.sessionURL = LogRocket.sessionURL; + return data; + }; + } } } },