From e3e22fadb58539a1e9a34706ce39f19510bdabf3 Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Thu, 29 May 2025 11:16:24 -0400 Subject: [PATCH] Add event to action cards --- src/components/ActionCard.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/ActionCard.tsx b/src/components/ActionCard.tsx index 4af44425a7..cc91849d04 100644 --- a/src/components/ActionCard.tsx +++ b/src/components/ActionCard.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { colors, ColorOption } from '@site/src/constants/colors'; import { Icon } from './Icon'; +import { event } from '@site/src/utils/gtags.client'; type LinkInfo = | { @@ -36,9 +37,22 @@ export const ActionCard: React.FC = ({ const href = 'href' in linkInfo ? linkInfo.href : undefined; const target = 'target' in linkInfo ? linkInfo.target : undefined; + const handleCardClick = (e: React.MouseEvent) => { + event({ + action: 'action_card_click', + category: 'action_card', + label: heading, + location: true, + }); + if (onClick) { + e.preventDefault(); + onClick(); + } + }; + return (