diff --git a/webapp/src/components/account/PassCard.tsx b/webapp/src/components/account/PassCard.tsx index 2697aef2..abe07d4a 100644 --- a/webapp/src/components/account/PassCard.tsx +++ b/webapp/src/components/account/PassCard.tsx @@ -14,12 +14,15 @@ import { useAuth } from "~/providers/Auth"; import NewPassComponent from "../NewPassComponent"; import Image from "next/image"; import LoadingLoader from "../LoadingLoader"; +import { push } from "@socialgouv/matomo-next"; +import { OfferIncluded } from "~/server/api/routers/offer"; type PropsPassCard = { isPage: boolean; + offer?: OfferIncluded; }; -const PassCard = ({ isPage }: PropsPassCard) => { +const PassCard = ({ isPage, offer }: PropsPassCard) => { const { user } = useAuth(); const { @@ -94,6 +97,14 @@ const PassCard = ({ isPage }: PropsPassCard) => { )} { + if (!isPage) + push([ + "trackEvent", + "Offre", + `${offer?.partner.name} - ${offer?.title} - Active - Présenter ma carte CJE`, + ]); + }} pointerEvents={isPage ? "none" : "auto"} tabIndex={isPage ? -1 : 0} aria-disabled={!isPage} diff --git a/webapp/src/components/offer/StepsButtons.tsx b/webapp/src/components/offer/StepsButtons.tsx index 7672b4e9..448e49aa 100644 --- a/webapp/src/components/offer/StepsButtons.tsx +++ b/webapp/src/components/offer/StepsButtons.tsx @@ -49,21 +49,14 @@ const StepsButtons = ({ push([ "trackEvent", "Offre", - `${offer.partner.name}`, - `${offer.title}`, - "Inactive", - "J'active mon offre", - "J'ai compris", + `${offer.partner.name} - ${offer.title} - Inactive - J'active mon offre - J'ai compris`, ]); setActiveStep(activeStep + 1); } else if (handleValidate) { push([ "trackEvent", "Offre", - `${offer.partner.name}`, - `${offer.title}`, - "Inactive", - "J'active mon offre - Validation", + `${offer.partner.name} - ${offer.title} - Inactive - J'active mon offre - Validation`, ]); setIsValidating(true); handleValidate().then(() => setIsValidating(false)); @@ -80,11 +73,11 @@ const StepsButtons = ({ push([ "trackEvent", "Offre", - `${offer.partner.name}`, - `${offer.title}`, - "Inactive", - "J'active mon offre", - `Cette offre ne m'intéresse pas ${activeStep === count ? "2" : ""}`, + `${offer.partner.name} - ${ + offer.title + } - Inactive - J'active mon offre - Cette offre ne m'intéresse pas ${ + activeStep === count ? "2" : "" + }`, ]); handleOnClose(); }} diff --git a/webapp/src/components/wrappers/CouponWrapper.tsx b/webapp/src/components/wrappers/CouponWrapper.tsx index 14d6e234..4242e1da 100644 --- a/webapp/src/components/wrappers/CouponWrapper.tsx +++ b/webapp/src/components/wrappers/CouponWrapper.tsx @@ -53,10 +53,7 @@ const CTAButton = ({ push([ "trackEvent", "Offre", - offer.partner.name, - offer.title, - "Active", - "Aller sur le site", + `${offer.partner.name} - ${offer.title} - Active - Aller sur le site`, ]); handleOpenExternalLink(); }} @@ -79,7 +76,7 @@ const CTAButton = ({ Ma carte CJE - + // -
- -
- - ); + if (isLoadingCategories || !categories) + return ( + +
+ +
+
+ ); - return ( - - {categories.map((category) => ( - { - push(['trackEvent', 'Explorer', 'Catégories', category.label]) - }}> - - {category.icon.alt - - {category.label} - - - - ))} - - ); + return ( + + {categories.map((category) => ( + { + push(["trackEvent", "Explorer", "Catégories - " + category.label]); + }} + > + + {category.icon.alt + + {category.label} + + + + ))} + + ); } diff --git a/webapp/src/pages/dashboard/category/[slug].tsx b/webapp/src/pages/dashboard/category/[slug].tsx index 4eb40662..93297223 100644 --- a/webapp/src/pages/dashboard/category/[slug].tsx +++ b/webapp/src/pages/dashboard/category/[slug].tsx @@ -50,11 +50,7 @@ export default function CategoryOfferList() { offer={offer} matomoEvent={[ "Explorer", - "Catégories", - category.label, - "Offre", - offer.partner.name, - offer.title, + `Catégories - ${category.label} - Offre - ${offer.partner.name} - ${offer.title}`, ]} /> ))} diff --git a/webapp/src/pages/dashboard/index.tsx b/webapp/src/pages/dashboard/index.tsx index 4da2c235..127f4d4e 100644 --- a/webapp/src/pages/dashboard/index.tsx +++ b/webapp/src/pages/dashboard/index.tsx @@ -105,7 +105,11 @@ export default function Dashboard() { key={category.id} href={`/dashboard/category/${category.slug}`} onClick={() => { - push(["trackEvent", "Accueil", "Catégories", category.label]); + push([ + "trackEvent", + "Accueil", + "Catégories - " + category.label, + ]); }} passHref > @@ -193,10 +197,7 @@ export default function Dashboard() { push([ "trackEvent", "Accueil", - "Accès rapide", - "Offre", - quickAccess.offer.partner.name, - quickAccess.offer.title, + `Accès rapide - Offre - ${quickAccess.offer.partner.name} - ${quickAccess.offer.title}`, ]); }} passHref @@ -254,9 +255,7 @@ export default function Dashboard() { matomoEvent={[ "Accueil", "Pour vous", - "Offre", - offer.partner.name, - offer.title, + `Offre - ${offer.partner.name} - ${offer.title} `, ]} /> ))} diff --git a/webapp/src/pages/dashboard/offer/[id].tsx b/webapp/src/pages/dashboard/offer/[id].tsx index c231f384..6f213ca8 100644 --- a/webapp/src/pages/dashboard/offer/[id].tsx +++ b/webapp/src/pages/dashboard/offer/[id].tsx @@ -269,10 +269,9 @@ export default function OfferPage() { push([ "trackEvent", "Offre", - offer.partner.name, - offer.title, - !!coupon ? "Active" : "Inactive", - "Comment ça marche", + `${offer.partner.name} - ${offer.title} - ${ + !!coupon ? "Active" : "Inactive" + } - Comment ça marche`, ]); onOpenTermsOfUse(); }} @@ -331,10 +330,9 @@ export default function OfferPage() { push([ "trackEvent", "Offre", - offer.partner.name, - offer.title, - !!coupon ? "Active" : "Inactive", - "Conditions", + `${offer.partner.name} - ${offer.title} - ${ + !!coupon ? "Active" : "Inactive" + } - Conditions`, ]); onOpenOtherConditions(); }}