Skip to content

Commit

Permalink
add attributes to growth book
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Jan 10, 2024
1 parent 6ff8ee8 commit dbcb52f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
File renamed without changes.
5 changes: 4 additions & 1 deletion lib/mixpanel/useInit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { deviceType } from 'react-device-detect';

import config from 'configs/app';
import * as cookies from 'lib/cookies';
import { growthBook } from 'lib/growthbook/index';
import { growthBook } from 'lib/growthbook/init';
import getQueryParamString from 'lib/router/getQueryParamString';

export default function useMixpanelInit() {
Expand All @@ -29,6 +29,9 @@ export default function useMixpanelInit() {
growthBook?.setAttributes({
...growthBook.getAttributes(),
id: mixpanel.get_distinct_id(),
time_zone: Intl.DateTimeFormat().resolvedOptions().timeZone,
language: mixpanel.get_property('Language'),
chain_id: mixpanel.get_property('Chain id'),
});
},
};
Expand Down
2 changes: 1 addition & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import useQueryClientConfig from 'lib/api/useQueryClientConfig';
import { AppContextProvider } from 'lib/contexts/app';
import { ChakraProvider } from 'lib/contexts/chakra';
import { ScrollDirectionProvider } from 'lib/contexts/scrollDirection';
import { growthBook } from 'lib/growthbook/index';
import { growthBook } from 'lib/growthbook/init';
import { SocketProvider } from 'lib/socket/context';
import theme from 'theme';
import AppErrorBoundary from 'ui/shared/AppError/AppErrorBoundary';
Expand Down

0 comments on commit dbcb52f

Please sign in to comment.