From 57cf7d4e9b440e7029a3b1e8147a229ce50fd7c6 Mon Sep 17 00:00:00 2001 From: Ingrid Gladheim Date: Thu, 5 Dec 2024 13:43:37 +0100 Subject: [PATCH] =?UTF-8?q?IS-2854:=20m=C3=A5le=20hvilke=20s=C3=B8kefelt?= =?UTF-8?q?=20som=20blir=20brukt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/sokperson/SokPerson.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/sokperson/SokPerson.tsx b/src/components/sokperson/SokPerson.tsx index 2c5b0492..0d20ac1a 100644 --- a/src/components/sokperson/SokPerson.tsx +++ b/src/components/sokperson/SokPerson.tsx @@ -29,12 +29,17 @@ const texts = { error: 'Noe gikk galt under søket. Vennligst prøv igjen.', }; -function logSokPersonEvent() { +function logSokPersonEvent(requestDTO: SokDTO) { + const hasInitials = !!requestDTO.initials; + const hasBirthdate = !!requestDTO.birthdate; Amplitude.logEvent({ type: Amplitude.EventType.ButtonClick, data: { url: window.location.href, - tekst: 'Søk etter sykmeldt', + tekst: + 'Søk etter sykmeldt -' + hasBirthdate && + ' fødselsdato' + hasInitials && + ' initialer', }, }); } @@ -85,7 +90,7 @@ export default function SokPerson() { }; mutate(requestDTO, { onSuccess: (data) => logSokPersonResults(data.length), - onSettled: () => logSokPersonEvent(), + onSettled: () => logSokPersonEvent(requestDTO), }); } else { setIsFormError(true);