From 1aab6869a07a9b682e3db56442866b141b690ef0 Mon Sep 17 00:00:00 2001 From: satbir121 <39981226+satbir121@users.noreply.github.com> Date: Tue, 4 Aug 2020 17:57:25 +0530 Subject: [PATCH] Fixing user not logged in analytics. (#216) --- app/client/src/sagas/userSagas.tsx | 1 + app/client/src/utils/AnalyticsUtil.tsx | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/client/src/sagas/userSagas.tsx b/app/client/src/sagas/userSagas.tsx index 1802d186ed..4beee686e6 100644 --- a/app/client/src/sagas/userSagas.tsx +++ b/app/client/src/sagas/userSagas.tsx @@ -78,6 +78,7 @@ export function* getCurrentUserSaga() { const isValidResponse = yield validateResponse(response); if (isValidResponse) { + AnalyticsUtil.identifyUser(response.data.username, response.data); if (window.location.pathname === BASE_URL) { if (response.data.isAnonymous) { history.replace(AUTH_LOGIN_URL); diff --git a/app/client/src/utils/AnalyticsUtil.tsx b/app/client/src/utils/AnalyticsUtil.tsx index 5b61253ee0..3c1030d5e8 100644 --- a/app/client/src/utils/AnalyticsUtil.tsx +++ b/app/client/src/utils/AnalyticsUtil.tsx @@ -175,8 +175,7 @@ class AnalyticsUtil { userData: { userId: userData.id, email: userData.email, - currentOrgId: userData.currentOrganization.id, - currentOrgName: userData.currentOrganization.name, + currentOrgId: userData.currentOrganizationId, appId: appId, appName: app ? app.name : undefined, },