Skip to content

Commit

Permalink
Add isCorporate flag to analytics identify (#19564)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Roes authored Nov 18, 2022
1 parent 061bce1 commit 937f6b4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions airbyte-webapp/src/packages/cloud/cloudRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const MainViewRoutes = () => {
};

export const Routing: React.FC = () => {
const { user, inited, providers } = useAuthService();
const { user, inited, providers, hasCorporateEmail } = useAuthService();

const { search } = useLocation();

Expand All @@ -146,9 +146,15 @@ export const Routing: React.FC = () => {
: null,
[user]
);

const userTraits = useMemo(
() => (user ? { providers, email: user.email, isCorporate: hasCorporateEmail() } : {}),
[hasCorporateEmail, providers, user]
);

useGetSegmentAnonymousId();
useAnalyticsRegisterValues(analyticsContext);
useAnalyticsIdentifyUser(user?.userId, { providers, email: user?.email });
useAnalyticsIdentifyUser(user?.userId, userTraits);

if (!inited) {
return <LoadingPage />;
Expand Down

0 comments on commit 937f6b4

Please sign in to comment.