Skip to content

Commit ef5fa69

Browse files
committed
remove fallback matomo event on ButtonLink
1 parent a909caa commit ef5fa69

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/components/Buttons/ButtonLink.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,11 @@ export type ButtonLinkProps = LinkProps &
99
}
1010

1111
const ButtonLink = ({ customEventOptions, ...props }: ButtonLinkProps) => {
12-
const matomoEvent = customEventOptions ?? {
13-
eventCategory: "Link",
14-
eventAction: "clicked",
15-
eventName: "ButtonLink clicked",
16-
eventValue: (props.to ?? props.href) as string,
12+
const handleClick = () => {
13+
customEventOptions && trackCustomEvent(customEventOptions)
1714
}
1815
return (
19-
<Button
20-
as={BaseLink}
21-
activeStyle={{}}
22-
{...props}
23-
onClick={() => trackCustomEvent(matomoEvent)}
24-
/>
16+
<Button as={BaseLink} activeStyle={{}} {...props} onClick={handleClick} />
2517
)
2618
}
2719

0 commit comments

Comments
 (0)