Skip to content

Commit

Permalink
feat: ajout tracking televersement (#3770)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrmr authored Jul 22, 2024
1 parent 3622806 commit 86fe0df
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
fileignoreconfig:
- filename: ui/components/Televersement/DocumentsActionButtons.tsx
checksum: f3598ec013dca8f849c41c42cd8c0c75457ece9166b36717e8d1db84cfde12fa
- filename: ui/modules/referencement-organisme/ReferencementOrganisme.tsx
checksum: 6e755a406ed7a6901f59e3581ea5485d6f42b02b3d062d2fe6a50b044ea8c392
- filename: ui/modules/aide/AideCodeRncp.tsx
Expand Down
9 changes: 9 additions & 0 deletions shared/constants/plausible-goals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const plausibleGoals = [
// Page SIFA
"clic_depot_plateforme_sifa",
"clic_toggle_sifa_données_manquantes",
"clic_sifa_faq",

// Téléchargements
// - Page indicateurs
Expand Down Expand Up @@ -67,6 +68,14 @@ export const plausibleGoals = [
"referencement_telechargement_fichier",
"referencement_clic_responsable_donnee",
"referencement_clic_modification_donnee",

// - Page téléversement
"televersement_clic_telechargement_excel",
"televersement_clic_modale_donnees_obligatoires",
"televersement_clic_guide_donnees",
"televersement_clic_tutoriel_video",
"televersement_clic_excel_conseils",
"televersement_clic_rapport_transmission",
] as const;

export type PlausibleGoalType = (typeof plausibleGoals)[number];
Expand Down
9 changes: 8 additions & 1 deletion ui/components/Notifications/TransmissionErrors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import React, { useEffect, useState } from "react";

import { _put } from "@/common/httpClient";
import { Organisme } from "@/common/internal/Organisme";
import { usePlausibleTracking } from "@/hooks/plausible";

import Ribbons from "../Ribbons/Ribbons";

const NotificationTransmissionError = ({ organisme }: { organisme: Organisme }) => {
const [hasTransmissionError, setHasTransmissionError] = useState<boolean>(false);
const { trackPlausibleEvent } = usePlausibleTracking();

useEffect(() => {
if (organisme?.has_transmission_errors) {
Expand All @@ -35,7 +37,12 @@ const NotificationTransmissionError = ({ organisme }: { organisme: Organisme })
}`}
</strong>
. Consultez le{" "}
<Link href="/transmissions" display="inline" textDecoration="underline">
<Link
href="/transmissions"
display="inline"
textDecoration="underline"
onClick={() => trackPlausibleEvent("televersement_clic_rapport_transmission")}
>
rapport de transmission
</Link>{" "}
pour les identifier et les corriger. Une fois la correction effectuée, vous pouvez fermer ce bandeau et
Expand Down
19 changes: 16 additions & 3 deletions ui/components/Televersement/DocumentsActionButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Flex } from "@chakra-ui/react";

import { usePlausibleTracking } from "@/hooks/plausible";
import InfoTeleversement from "@/modules/organismes/InfoTeleversement";
import { Book } from "@/theme/components/icons";
import DownloadSimple from "@/theme/components/icons/DownloadSimple";
Expand All @@ -10,9 +11,14 @@ import ButtonTeleversement from "../buttons/ButtonTeleversement";
import { BasicModal } from "../Modals/BasicModal";

export default function DocumentsActionButtons() {
const { trackPlausibleEvent } = usePlausibleTracking();

return (
<Flex mt={4} gap={6} mb={5}>
<ButtonTeleversement href="/modele-import.xlsx">
<ButtonTeleversement
href="/modele-import.xlsx"
onClick={() => trackPlausibleEvent("televersement_clic_telechargement_excel")}
>
<DownloadSimple mr={2} />
Télécharger le modèle Excel
</ButtonTeleversement>
Expand All @@ -21,6 +27,7 @@ export default function DocumentsActionButtons() {
<ButtonTeleversement
onClick={(e) => {
e.preventDefault();
trackPlausibleEvent("televersement_clic_modale_donnees_obligatoires");
onOpen();
}}
>
Expand All @@ -33,11 +40,17 @@ export default function DocumentsActionButtons() {
>
<InfoTeleversement />
</BasicModal>
<ButtonTeleversement href="https://mission-apprentissage.notion.site/Guide-des-donn-es-57bc2515bac34cee9359e517a504df20">
<ButtonTeleversement
href="https://mission-apprentissage.notion.site/Guide-des-donn-es-57bc2515bac34cee9359e517a504df20"
onClick={() => trackPlausibleEvent("televersement_clic_guide_donnees")}
>
<Book mr={2} />
Guide des données
</ButtonTeleversement>
<ButtonTeleversement href="https://www.canva.com/design/DAF0aDLacTk/ZxY16rI7C_vBzEuyrEpbIA/watch">
<ButtonTeleversement
href="https://www.canva.com/design/DAF0aDLacTk/ZxY16rI7C_vBzEuyrEpbIA/watch"
onClick={() => trackPlausibleEvent("televersement_clic_tutoriel_video")}
>
<Video mr={2} />
Tutoriel en vidéo
</ButtonTeleversement>
Expand Down
8 changes: 7 additions & 1 deletion ui/components/Televersement/InfoBetaPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ import { ChevronDownIcon, ChevronUpIcon } from "@chakra-ui/icons";
import { Collapse, UnorderedList, ListItem, Text, Link } from "@chakra-ui/react";
import { useState } from "react";

import { usePlausibleTracking } from "@/hooks/plausible";

import Ribbons from "../Ribbons/Ribbons";

export default function InfoBetaPanel() {
const [show, setShow] = useState(false);
const handleToggle = () => setShow(!show);
const handleToggle = () => {
setShow(!show);
trackPlausibleEvent("televersement_clic_excel_conseils");
};
const { trackPlausibleEvent } = usePlausibleTracking();

const linkStyle = {
color: "#000091",
Expand Down
1 change: 1 addition & 0 deletions ui/modules/mon-espace/SIFA/SIFAPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ const SIFAPage = (props: SIFAPageProps) => {
href={"https://mission-apprentissage.notion.site/Enqu-te-SIFA-a546590b47764051bf1c486b1d57d227"}
textDecoration={"underline"}
isExternal
plausibleGoal="clic_sifa_faq"
>
FAQ dédiée
</Link>
Expand Down

0 comments on commit 86fe0df

Please sign in to comment.