Remove analytics middleware

I never found this data to be as valuable as I thought it would be.
This commit is contained in:
Jordan Eldredge 2018-05-13 12:34:02 -07:00
parent fc9f1268e9
commit 967a4d4fea
3 changed files with 2 additions and 38 deletions

View file

@ -1,33 +0,0 @@
/* global ga */
import {
STEP_MARQUEE,
SET_SCRUB_POSITION,
SET_VOLUME,
UPDATE_TIME_ELAPSED,
SET_BALANCE,
SET_BAND_VALUE
} from "./actionTypes";
const excludeActionTypes = new Set([
STEP_MARQUEE,
SET_SCRUB_POSITION,
SET_VOLUME,
UPDATE_TIME_ELAPSED,
SET_BALANCE,
SET_BAND_VALUE
]);
export default function analyticsMiddleware() {
return next => action => {
if (!excludeActionTypes.has(action.type) && typeof ga !== "undefined") {
ga("send", {
hitType: "event",
eventCategory: "Redux Store", // Typically the object that was interacted with (e.g. 'Video')
eventAction: action.type // The type of interaction (e.g. 'play')
// eventLabel: "Fall Campaign", // Useful for categorizing events (e.g. 'Fall Campaign')
// eventValue: "Fall Campaign" // A numeric value associated with the event (e.g. 42)
});
}
return next(action);
};
}

View file

@ -19,7 +19,6 @@ import {
SET_BALANCE,
SET_BAND_VALUE
} from "./actionTypes";
import analyticsMiddleware from "./analyticsMiddleware";
import {
hideAbout,
@ -147,7 +146,7 @@ Raven.context(() => {
enableHotkeys: true,
__extraWindows,
__initialState: initialState,
__customMiddlewares: [analyticsMiddleware, ravenMiddleware]
__customMiddlewares: [ravenMiddleware]
});
webamp.renderWhenReady(document.getElementById("app"));

View file

@ -5,7 +5,6 @@ import reducer from "./reducers";
import mediaMiddleware from "./mediaMiddleware";
import { merge } from "./utils";
import { UPDATE_TIME_ELAPSED, STEP_MARQUEE } from "./actionTypes";
import analyticsMiddleware from "./analyticsMiddleware";
const compose = composeWithDevTools({
actionsBlacklist: [UPDATE_TIME_ELAPSED, STEP_MARQUEE]
@ -40,8 +39,7 @@ const getStore = (
thunk,
mediaMiddleware(media),
emitterMiddleware,
...customMiddlewares,
analyticsMiddleware
...customMiddlewares
].filter(Boolean)
)
)