Skip to content

Commit 686c45a

Browse files
committed
matomo events
1 parent 6853987 commit 686c45a

File tree

3 files changed

+31
-40
lines changed

3 files changed

+31
-40
lines changed

src/components/Resources/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export const ResourceItem = ({
3131
"flex gap-2 border-b p-3 text-body no-underline last-of-type:border-0 hover:bg-background-highlight hover:text-body",
3232
className
3333
)}
34+
customEventOptions={{
35+
eventCategory: "dashboard",
36+
eventAction: "links",
37+
eventName: title,
38+
}}
3439
hideArrow
3540
>
3641
<div className="my-1 size-[18px] shrink-0">

src/pages/[locale]/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,11 @@ const HomePage = ({
371371
href="/resources/"
372372
isSecondary
373373
variant="outline"
374-
onClick={() =>
375-
trackCustomEvent({
376-
eventCategory,
377-
eventAction: "ethereum_activity",
378-
eventName: "ethereum_activity",
379-
})
380-
}
374+
customEventOptions={{
375+
eventCategory: eventCategory,
376+
eventAction: "ethereum_activity",
377+
eventName: "ethereum_activity",
378+
}}
381379
>
382380
{t("page-index:page-index-activity-action")} <ChevronNext />
383381
</ButtonLink>

src/pages/[locale]/resources.tsx

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { cn } from "@/lib/utils/cn"
2121
import { dataLoader } from "@/lib/utils/data/dataLoader"
2222
import { existsNamespace } from "@/lib/utils/existsNamespace"
2323
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
24-
import { trackCustomEvent } from "@/lib/utils/matomo"
2524
import { getLocaleTimestamp } from "@/lib/utils/time"
2625
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
2726

@@ -107,12 +106,10 @@ const ResourcesPage = ({ txCostsMedianUsd }) => {
107106
GITHUB_REPO_URL
108107
).toString()}
109108
className="visited:text-white"
110-
onClick={() => {
111-
trackCustomEvent({
112-
eventCategory: EVENT_CATEGORY,
113-
eventAction: "links",
114-
eventName: "Ethereum.org Github Page Feedback",
115-
})
109+
customEventOptions={{
110+
eventCategory: EVENT_CATEGORY,
111+
eventAction: "links",
112+
eventName: "Ethereum.org Github Page Feedback",
116113
}}
117114
>
118115
{t("page-resources-share-feedback")}
@@ -141,14 +138,11 @@ const ResourcesPage = ({ txCostsMedianUsd }) => {
141138
"relative text-nowrap rounded-xl px-4 py-2 text-sm [&_svg]:shrink-0 [&_svg]:text-sm",
142139
activeSection === key && "!text-primary"
143140
)}
144-
onClick={() =>
145-
trackCustomEvent({
146-
eventCategory: EVENT_CATEGORY,
147-
eventAction: "whats_on_this_page",
148-
eventName:
149-
"network,using, scaling, resilience, privacy_security",
150-
})
151-
}
141+
customEventOptions={{
142+
eventCategory: EVENT_CATEGORY,
143+
eventAction: "whats_on_this_page",
144+
eventName: key,
145+
}}
152146
>
153147
{activeSection === key && (
154148
<motion.div
@@ -209,12 +203,10 @@ const ResourcesPage = ({ txCostsMedianUsd }) => {
209203
<ButtonLink
210204
href="https://ethereumdashboards.com"
211205
size="lg"
212-
onClick={() => {
213-
trackCustomEvent({
214-
eventCategory: EVENT_CATEGORY,
215-
eventAction: "links",
216-
eventName: "ethereumdashboards.com",
217-
})
206+
customEventOptions={{
207+
eventCategory: EVENT_CATEGORY,
208+
eventAction: "links",
209+
eventName: "ethereumdashboards.com",
218210
}}
219211
>
220212
ethereumdashboards.com
@@ -242,12 +234,10 @@ const ResourcesPage = ({ txCostsMedianUsd }) => {
242234
).toString()}
243235
variant="outline"
244236
isSecondary
245-
onClick={() => {
246-
trackCustomEvent({
247-
eventCategory: EVENT_CATEGORY,
248-
eventAction: "links",
249-
eventName: "Ethereum.org Github Feature Request",
250-
})
237+
customEventOptions={{
238+
eventCategory: EVENT_CATEGORY,
239+
eventAction: "links",
240+
eventName: "Ethereum.org Github Feature Request",
251241
}}
252242
>
253243
{t("page-resources-suggest-resource")}
@@ -259,12 +249,10 @@ const ResourcesPage = ({ txCostsMedianUsd }) => {
259249
).toString()}
260250
variant="outline"
261251
isSecondary
262-
onClick={() => {
263-
trackCustomEvent({
264-
eventCategory: EVENT_CATEGORY,
265-
eventAction: "links",
266-
eventName: "Ethereum.org Github Bug Report",
267-
})
252+
customEventOptions={{
253+
eventCategory: EVENT_CATEGORY,
254+
eventAction: "links",
255+
eventName: "Ethereum.org Github Bug Report",
268256
}}
269257
>
270258
<FaGithub /> {t("page-resources-found-bug")}

0 commit comments

Comments
 (0)