diff --git a/packages/keychain/src/hooks/connection.ts b/packages/keychain/src/hooks/connection.ts index 7b521508d..1224351bd 100644 --- a/packages/keychain/src/hooks/connection.ts +++ b/packages/keychain/src/hooks/connection.ts @@ -84,15 +84,12 @@ export function useConnectionValue() { }, [context, parent]); const setController = useCallback((controller?: Controller) => { - if (controller && controller.cartridge && origin) { - posthog.identify(controller.cartridge.username(), { + if (controller) { + posthog.identify(controller.username(), { address: controller.address, class: controller.cartridge.classHash, chainId: controller.chainId, - appId: origin, }); - - posthog.group("company", origin); } else { posthog.reset(); } @@ -101,6 +98,12 @@ export function useConnectionValue() { setIsSignedUp(); }, []); + useEffect(() => { + if (origin) { + posthog.group("company", origin); + } + }, [origin]); + useEffect(() => { const urlParams = new URLSearchParams(window.location.search);