Skip to content

Commit

Permalink
Added user role tracking for view route
Browse files Browse the repository at this point in the history
  • Loading branch information
sinhaaaryan committed Dec 17, 2024
1 parent 3606852 commit 490c676
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/UserCards/UserCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export const UserCard = (props: UserCardProps): JSX.Element => {
onClick={() => {
props.onViewRouteClick &&
props.onViewRouteClick(user, props.otherUser);
trackViewRoute();
trackViewRoute(user.role);
}}
className="my-1 w-1/2 rounded-md border border-black p-1 text-center hover:bg-stone-200 disabled:hover:bg-transparent"
>
Expand All @@ -248,7 +248,7 @@ export const UserCard = (props: UserCardProps): JSX.Element => {
<button
onClick={() => {
if (props.rightButton?.onPress) {
trackViewRoute();
trackViewRoute(user.role);
props.rightButton.onPress(props.otherUser);
}
}}
Expand Down
3 changes: 2 additions & 1 deletion src/utils/mixpanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ export const trackProfileCompletion = (role: string, status: string) => {
};

// Add this new function
export const trackViewRoute = () => {
export const trackViewRoute = (role: string) => {
trackEvent("View Route Clicked", {
role,
timestamp: new Date().toISOString(),
});
};
Expand Down

0 comments on commit 490c676

Please sign in to comment.