Skip to content

Commit b323cff

Browse files
committed
fix(analytics): update user_properties when location update
1 parent d9665b9 commit b323cff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/hooks/useAnalytics.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import { useEffect } from "react";
33
import ReactGA4 from "react-ga4";
44
import Clarity from "@microsoft/clarity";
55
import { useUser } from "@/hooks/useUser";
6+
import { useLocation } from "react-router";
67

78
export const useAnalytics = () => {
89
const { uuid, gender, profile, viewer, authProvider } = useUser();
10+
const location = useLocation();
911

1012
useEffect(() => {
1113
if (GA_ID)
@@ -33,5 +35,5 @@ export const useAnalytics = () => {
3335
auth_provider: authProvider ?? undefined,
3436
},
3537
});
36-
}, [authProvider, gender, profile, viewer]);
38+
}, [authProvider, gender, profile, viewer, location]);
3739
};

0 commit comments

Comments
 (0)