Skip to content

Commit 895147d

Browse files
committed
add: event tracking on edit_page
1 parent 23712db commit 895147d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/components/TableOfContents/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { usePathname } from "next/navigation"
12
import { useTranslation } from "next-i18next"
23
import { FaGithub } from "react-icons/fa"
34
import {
@@ -36,6 +37,7 @@ const TableOfContents = ({
3637
isMobile = false,
3738
...rest
3839
}: TableOfContentsProps) => {
40+
const pathname = usePathname()
3941
const { t } = useTranslation("common")
4042
// TODO: Replace with direct token implementation after UI migration is completed
4143
const lgBp = useToken("breakpoints", "lg")
@@ -85,6 +87,11 @@ const TableOfContents = ({
8587
leftIcon={<Icon as={FaGithub} />}
8688
href={editPath}
8789
variant="outline"
90+
customEventOptions={{
91+
eventCategory: "edit_page",
92+
eventAction: "gh_edit_click",
93+
eventName: `${pathname}`,
94+
}}
8895
>
8996
{t("edit-page")}
9097
</ButtonLink>

0 commit comments

Comments
 (0)