Skip to content

Commit f758828

Browse files
committed
matomo: add "popular topics" events
1 parent e4d547f commit f758828

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed

src/components/Homepage/useHome.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,28 +127,33 @@ export const useHome = () => {
127127
label: t("page-index:page-index-popular-topics-ethereum"),
128128
Svg: EthTokenIcon,
129129
href: "/what-is-ethereum/",
130+
eventName: "ethereum",
130131
},
131132
{
132133
label: t("page-index:page-index-popular-topics-wallets"),
133134
Svg: PickWalletIcon,
134135
href: "/wallets/",
136+
eventName: "wallets",
135137
},
136138
{
137139
label: t("page-index:page-index-popular-topics-start"),
138140
Svg: BlockHeap,
139141
href: "/guides/",
142+
eventName: "start guides",
140143
},
141144
{
142145
label: t("page-index:page-index-popular-topics-whitepaper"),
143146
Svg: Whitepaper,
144147
className: cn(isRtl && "[&_svg]:-scale-x-100"),
145148
href: "/whitepaper/",
149+
eventName: "whitepaper",
146150
},
147151
{
148152
label: t("page-index:page-index-popular-topics-roadmap"),
149153
Svg: RoadmapSign,
150154
className: cn(isRtl && "[&_svg]:-scale-x-100"),
151155
href: "/roadmap/",
156+
eventName: "roadmap",
152157
},
153158
]
154159

src/pages/index.tsx

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -357,21 +357,28 @@ const HomePage = ({
357357
{t("page-index:page-index-popular-topics-header")}
358358
</h3>
359359
<div className="grid grid-cols-1 gap-8 sm:grid-cols-2 md:grid-cols-1 lg:grid-cols-2">
360-
{popularTopics.map(({ label, Svg, href, className }) => (
361-
<SvgButtonLink
362-
key={label}
363-
Svg={Svg}
364-
href={href}
365-
className={cn(
366-
"text-accent-b hover:text-accent-b-hover [&>:first-child]:flex-row",
367-
className
368-
)}
369-
>
370-
<p className="text-start text-xl font-bold text-body group-hover:underline">
371-
{label}
372-
</p>
373-
</SvgButtonLink>
374-
))}
360+
{popularTopics.map(
361+
({ label, Svg, href, eventName, className }) => (
362+
<SvgButtonLink
363+
key={label}
364+
Svg={Svg}
365+
href={href}
366+
className={cn(
367+
"text-accent-b hover:text-accent-b-hover [&>:first-child]:flex-row",
368+
className
369+
)}
370+
customEventOptions={{
371+
eventCategory: "Homepage",
372+
eventAction: "popular topics",
373+
eventName,
374+
}}
375+
>
376+
<p className="text-start text-xl font-bold text-body group-hover:underline">
377+
{label}
378+
</p>
379+
</SvgButtonLink>
380+
)
381+
)}
375382
</div>
376383
<div className="flex py-8 sm:justify-center">
377384
<ButtonLink

0 commit comments

Comments
 (0)