From 895147df619e4575e0130765f72666576789470c Mon Sep 17 00:00:00 2001 From: rohit-gupta001 Date: Sun, 4 Aug 2024 17:48:00 +0530 Subject: [PATCH] add: event tracking on edit_page --- src/components/TableOfContents/index.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/TableOfContents/index.tsx b/src/components/TableOfContents/index.tsx index 6f8beaaae10..318cd119904 100644 --- a/src/components/TableOfContents/index.tsx +++ b/src/components/TableOfContents/index.tsx @@ -1,3 +1,4 @@ +import { usePathname } from "next/navigation" import { useTranslation } from "next-i18next" import { FaGithub } from "react-icons/fa" import { @@ -36,6 +37,7 @@ const TableOfContents = ({ isMobile = false, ...rest }: TableOfContentsProps) => { + const pathname = usePathname() const { t } = useTranslation("common") // TODO: Replace with direct token implementation after UI migration is completed const lgBp = useToken("breakpoints", "lg") @@ -85,6 +87,11 @@ const TableOfContents = ({ leftIcon={} href={editPath} variant="outline" + customEventOptions={{ + eventCategory: "edit_page", + eventAction: "gh_edit_click", + eventName: `${pathname}`, + }} > {t("edit-page")}