diff --git a/components/molecules/ContributorProfileHeader/contributor-profile-header.tsx b/components/molecules/ContributorProfileHeader/contributor-profile-header.tsx index c6df0d8c9b..4ae06807d4 100644 --- a/components/molecules/ContributorProfileHeader/contributor-profile-header.tsx +++ b/components/molecules/ContributorProfileHeader/contributor-profile-header.tsx @@ -8,6 +8,7 @@ import { MarkGithubIcon } from "@primer/octicons-react"; import { User } from "@supabase/supabase-js"; import { FiCopy } from "react-icons/fi"; import { useToast } from "lib/hooks/useToast"; +import { usePostHogContext } from "posthog-js/react"; interface ContributorProfileHeaderProps { avatarUrl?: string; @@ -33,6 +34,7 @@ const ContributorProfileHeader = ({ handleSignIn, isOwner }: ContributorProfileHeaderProps) => { + const posthog = usePostHogContext(); const { toast } = useToast(); const [host, setHost] = useState(""); const handleFollowClick = () => { @@ -45,6 +47,12 @@ const ContributorProfileHeader = ({ const handleCopyToClipboard = async (content: string) => { const url = new URL(content).toString(); + posthog.capture( + "clicked: profile copied", + { + profile: user?.user_metadata.user_name, + }); + try { await navigator.clipboard.writeText(url); toast({ description: "Copied to clipboard", variant: "success" });