Analytics
This commit is contained in:
@ -85,11 +85,6 @@ const UIMiddleware = (function(){
|
|||||||
next(action)
|
next(action)
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'PLAYLIST_LOADED':
|
|
||||||
if (action.data) ReactGA.event({ category: 'Playlist', action: 'Load', label: action.playlist.uri })
|
|
||||||
next(action)
|
|
||||||
break
|
|
||||||
|
|
||||||
case 'ARTIST_LOADED':
|
case 'ARTIST_LOADED':
|
||||||
if (action.data) ReactGA.event({ category: 'Artist', action: 'Load', label: action.artist.uri })
|
if (action.data) ReactGA.event({ category: 'Artist', action: 'Load', label: action.artist.uri })
|
||||||
next(action)
|
next(action)
|
||||||
@ -215,6 +210,11 @@ const UIMiddleware = (function(){
|
|||||||
next(action)
|
next(action)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
case 'PUSHER_UPDATE_RADIO':
|
||||||
|
ReactGA.event({ category: 'Pusher', action: 'Update radio', label: action.uris.join() })
|
||||||
|
next(action)
|
||||||
|
break
|
||||||
|
|
||||||
case 'PUSHER_STOP_RADIO':
|
case 'PUSHER_STOP_RADIO':
|
||||||
ReactGA.event({ category: 'Pusher', action: 'Stop radio' })
|
ReactGA.event({ category: 'Pusher', action: 'Stop radio' })
|
||||||
next(action)
|
next(action)
|
||||||
@ -280,8 +280,7 @@ const UIMiddleware = (function(){
|
|||||||
break
|
break
|
||||||
|
|
||||||
case 'PLAYLIST_TRACKS_ADDED':
|
case 'PLAYLIST_TRACKS_ADDED':
|
||||||
store.dispatch(uiActions.createNotification('Added '+action.tracks_uris.length+' tracks to playlist'))
|
store.dispatch(uiActions.createNotification('Added '+action.tracks_uris.length+' tracks to playlist'))
|
||||||
|
|
||||||
switch(helpers.uriSource(action.key)){
|
switch(helpers.uriSource(action.key)){
|
||||||
case 'spotify':
|
case 'spotify':
|
||||||
store.dispatch(spotifyActions.getPlaylist(action.key))
|
store.dispatch(spotifyActions.getPlaylist(action.key))
|
||||||
@ -294,8 +293,9 @@ const UIMiddleware = (function(){
|
|||||||
break
|
break
|
||||||
|
|
||||||
case 'PLAYLIST_LOADED':
|
case 'PLAYLIST_LOADED':
|
||||||
var playlist = Object.assign({}, action.playlist)
|
if (action.data) ReactGA.event({ category: 'Playlist', action: 'Load', label: action.playlist.uri })
|
||||||
|
|
||||||
|
var playlist = Object.assign({}, action.playlist)
|
||||||
switch (helpers.uriSource(playlist.uri)){
|
switch (helpers.uriSource(playlist.uri)){
|
||||||
|
|
||||||
case 'm3u':
|
case 'm3u':
|
||||||
@ -314,8 +314,9 @@ const UIMiddleware = (function(){
|
|||||||
break
|
break
|
||||||
|
|
||||||
case 'PLAYLISTS_LOADED':
|
case 'PLAYLISTS_LOADED':
|
||||||
var playlists = []
|
if (action.data) ReactGA.event({ category: 'Playlists', action: 'Load', label: action.playlists.length+' items' })
|
||||||
|
|
||||||
|
var playlists = []
|
||||||
for (var i = 0; i < action.playlists.length; i++){
|
for (var i = 0; i < action.playlists.length; i++){
|
||||||
var playlist = Object.assign({}, action.playlists[i])
|
var playlist = Object.assign({}, action.playlists[i])
|
||||||
|
|
||||||
@ -352,7 +353,7 @@ const UIMiddleware = (function(){
|
|||||||
|
|
||||||
case 'PUSHER_VERSION':
|
case 'PUSHER_VERSION':
|
||||||
ReactGA.event({ category: 'Pusher', action: 'Version', label: action.version.current })
|
ReactGA.event({ category: 'Pusher', action: 'Version', label: action.version.current })
|
||||||
|
|
||||||
if (action.version.upgrade_available){
|
if (action.version.upgrade_available){
|
||||||
store.dispatch( uiActions.createNotification( 'Version '+action.version.latest+' is available. See settings to upgrade.' ) )
|
store.dispatch( uiActions.createNotification( 'Version '+action.version.latest+' is available. See settings to upgrade.' ) )
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user