From b308da0473f6e60291861cdc90b33ee0a01cbc95 Mon Sep 17 00:00:00 2001 From: Rob Date: Mon, 15 Aug 2016 13:34:06 -0700 Subject: [PATCH] Add analytics even for LevelLoad errors. --- app/lib/LevelLoader.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/lib/LevelLoader.coffee b/app/lib/LevelLoader.coffee index e35af2996..2b3dc9249 100644 --- a/app/lib/LevelLoader.coffee +++ b/app/lib/LevelLoader.coffee @@ -79,6 +79,11 @@ module.exports = class LevelLoader extends CocoClass @listenToOnce @level, 'sync', @onLevelLoaded reportLoadError: -> + window.tracker?.trackEvent 'LevelLoadError', + category: 'Error', + levelSlug: @work?.level?.slug, + unloaded: JSON.stringify(@supermodel.report().map (m) -> _.result(m.model, 'url')) + return if me.isAdmin() or /dev=true/.test(window.location?.href ? '') or reportedLoadErrorAlready reportedLoadErrorAlready = true context = email: me.get('email')