We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a909caa commit ef5fa69Copy full SHA for ef5fa69
src/components/Buttons/ButtonLink.tsx
@@ -9,19 +9,11 @@ export type ButtonLinkProps = LinkProps &
9
}
10
11
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,
+ const handleClick = () => {
+ customEventOptions && trackCustomEvent(customEventOptions)
17
18
return (
19
- <Button
20
- as={BaseLink}
21
- activeStyle={{}}
22
- {...props}
23
- onClick={() => trackCustomEvent(matomoEvent)}
24
- />
+ <Button as={BaseLink} activeStyle={{}} {...props} onClick={handleClick} />
25
)
26
27
0 commit comments