From 32f4b2ae87caa1fd58146c22273d93e7c5bdd1cf Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Thu, 20 Apr 2017 17:00:37 +1200 Subject: [PATCH] Analytics --- src/js/services/ui/middleware.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/js/services/ui/middleware.js b/src/js/services/ui/middleware.js index 77caea7f..a6bfeaaa 100755 --- a/src/js/services/ui/middleware.js +++ b/src/js/services/ui/middleware.js @@ -49,6 +49,15 @@ const UIMiddleware = (function(){ next(action) break + case 'SPOTIFY_IMPORT_AUTHORIZATION': + var label = null + if (action.me && action.me.id){ + label = action.me.id + } + ReactGA.event({ category: 'Spotify', action: 'Authorization imported', label: label }) + next(action) + break + case 'ALBUM_LOADED': if (action.data) ReactGA.event({ category: 'Album', action: 'Load', label: action.album.uri }) @@ -134,6 +143,11 @@ const UIMiddleware = (function(){ next(action) break + case 'PUSHER_ERROR': + ReactGA.event({ category: 'Pusher', action: 'Error', label: action.message }) + next(action) + break + case 'SEARCH_STARTED': ReactGA.event({ category: 'Search', action: 'Started', label: action.type+': '+action.query })