diff --git a/website/client/libs/analytics.js b/website/client/libs/analytics.js index 23d619c53d..b42673f7fe 100644 --- a/website/client/libs/analytics.js +++ b/website/client/libs/analytics.js @@ -17,8 +17,6 @@ let ALLOWED_HIT_TYPES = [ 'timing', ]; -const store = getStore(); - function _doesNotHaveRequiredFields (properties) { if (!isEqual(keys(pick(properties, REQUIRED_FIELDS)), REQUIRED_FIELDS)) { // @TODO: Log with Winston? @@ -36,6 +34,7 @@ function _doesNotHaveAllowedHitType (properties) { } function _gatherUserStats (properties) { + const store = getStore(); const user = store.state.user.data; const tasks = store.state.tasks.data; @@ -65,6 +64,7 @@ function _gatherUserStats (properties) { } export function setUser () { + const store = getStore(); const user = store.state.user.data; window.amplitude.setUserId(user._id); window.ga('set', {userId: user._id}); diff --git a/website/client/store/actions/auth.js b/website/client/store/actions/auth.js index 3eccb02fd1..0a6cafa95b 100644 --- a/website/client/store/actions/auth.js +++ b/website/client/store/actions/auth.js @@ -50,8 +50,6 @@ export async function socialAuth (store, params) { authResponse: params.auth.authResponse, }); - // @TODO: Analytics - let user = result.data.data; let userLocalData = JSON.stringify({