diff --git a/src/components/Glossary/GlossaryTooltip/index.tsx b/src/components/Glossary/GlossaryTooltip/index.tsx index 75c48649fb9..708fa72bd2b 100644 --- a/src/components/Glossary/GlossaryTooltip/index.tsx +++ b/src/components/Glossary/GlossaryTooltip/index.tsx @@ -1,15 +1,21 @@ import React, { ReactNode } from "react" +import { useRouter } from "next/router" import { Box, Text } from "@chakra-ui/react" import GlossaryDefinition from "@/components/Glossary/GlossaryDefinition" import Tooltip from "@/components/Tooltip" +import { trackCustomEvent } from "@/lib/utils/matomo" +import { cleanPath } from "@/lib/utils/url" + type GlossaryTooltipProps = { children: ReactNode termKey: string } const GlossaryTooltip = ({ children, termKey }: GlossaryTooltipProps) => { + const { asPath } = useRouter() + return ( { options={{ ns: "glossary-tooltip" }} /> } + onOpen={() => { + trackCustomEvent({ + eventCategory: "Glossary Tooltip", + eventAction: cleanPath(asPath), + eventName: termKey, + }) + }} >