diff --git a/.changeset/quiet-rings-repair.md b/.changeset/quiet-rings-repair.md new file mode 100644 index 0000000000..3c56883601 --- /dev/null +++ b/.changeset/quiet-rings-repair.md @@ -0,0 +1,5 @@ +--- +"nextjs-website": patch +--- + +Add push event for chatbot button click diff --git a/apps/nextjs-website/src/components/atoms/ChatButton/ChatButton.tsx b/apps/nextjs-website/src/components/atoms/ChatButton/ChatButton.tsx index d9e9eaf822..af13446d39 100644 --- a/apps/nextjs-website/src/components/atoms/ChatButton/ChatButton.tsx +++ b/apps/nextjs-website/src/components/atoms/ChatButton/ChatButton.tsx @@ -9,13 +9,22 @@ type ChatButtonProps = { size: 'medium' | 'large'; }; +const matomoEvent = () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const _paq = (window as any)._paq || []; + // eslint-disable-next-line functional/immutable-data + _paq.push(['trackEvent', 'Chatbot interaction', 'Click chatbot', 'Click']); +}; const ChatButton = ({ isChatOpen, onOpenChat, size }: ChatButtonProps) => { const { palette } = useTheme(); return ( { + matomoEvent(); + onOpenChat(e); + }} size={size} sx={{ borderStyle: 'solid',