From 9ecc84f0b0063bedea8f3538f263a77c59b08521 Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Mon, 13 Mar 2023 15:11:43 +0100 Subject: [PATCH] [web] `download-pdf-button-click` event tracking (#12059) * [web] `download-pdf-button-click` event tracking GitOrigin-RevId: 20baae4fff989b5120ae03f81cc47f7d6874dd7b --- .../components/pdf-hybrid-download-button.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-hybrid-download-button.tsx b/services/web/frontend/js/features/pdf-preview/components/pdf-hybrid-download-button.tsx index d478e35aa6..592602329a 100644 --- a/services/web/frontend/js/features/pdf-preview/components/pdf-hybrid-download-button.tsx +++ b/services/web/frontend/js/features/pdf-preview/components/pdf-hybrid-download-button.tsx @@ -3,15 +3,23 @@ import { Button } from 'react-bootstrap' import Tooltip from '../../../shared/components/tooltip' import Icon from '../../../shared/components/icon' import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context' +import { useProjectContext } from '../../../shared/context/project-context' +import * as eventTracking from '../../../infrastructure/event-tracking' function PdfHybridDownloadButton() { const { pdfDownloadUrl } = useCompileContext() + const { _id: projectId } = useProjectContext() + const { t } = useTranslation() const description = pdfDownloadUrl ? t('download_pdf') : t('please_compile_pdf_before_download') + function handleOnClick() { + eventTracking.sendMB('download-pdf-button-click', { projectId }) + } + return (