diff --git a/packages/site/app/Accompagnement.tsx b/packages/site/app/Accompagnement.tsx
index 45882f6f78..73367feb03 100644
--- a/packages/site/app/Accompagnement.tsx
+++ b/packages/site/app/Accompagnement.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Button } from '@tet/ui';
+import { Button, useEventTracker } from '@tet/ui';
import { StrapiItem } from '@tet/site/src/strapi/StrapiItem';
import { StrapiImage } from '@tet/site/components/strapiImage/StrapiImage';
import Section from '@tet/site/components/sections/Section';
@@ -22,6 +22,8 @@ const Accompagnement = ({
description,
contenu,
}: AccompagnementProps) => {
+ const tracker = useEventTracker('site/accueil');
+
return (
-
-
{cta_inscription}
+
tracker('inscription_plateforme', {})}
+ >
+ {cta_inscription}
+
{!!collectivitesActivees && (
Déjà {collectivitesActivees} collectivités utilisatrices
@@ -47,7 +53,12 @@ const HeaderPlateforme = ({
)}
-
+ tracker('inscription_demo', {})}
+ variant="outlined"
+ icon="play-circle-line"
+ >
{cta_demo}
diff --git a/packages/site/app/outil-numerique/PanierActionsImpact.tsx b/packages/site/app/outil-numerique/PanierActionsImpact.tsx
index 36bb8a6867..77ce106d8f 100644
--- a/packages/site/app/outil-numerique/PanierActionsImpact.tsx
+++ b/packages/site/app/outil-numerique/PanierActionsImpact.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Button } from '@tet/ui';
+import { Button, useEventTracker } from '@tet/ui';
import Section from '@tet/site/components/sections/Section';
import { StrapiItem } from '@tet/site/src/strapi/StrapiItem';
import { StrapiImage } from '@tet/site/components/strapiImage/StrapiImage';
@@ -19,6 +19,8 @@ const PanierActionsImpact = ({
cta,
image,
}: PanierActionsImpactProps) => {
+ const tracker = useEventTracker('site/outil-numerique');
+
return (
tracker('decouvrir_pai', {})}
className="mt-6 max-lg:mx-auto"
>
{cta}
diff --git a/packages/site/app/outil-numerique/QuestionsPlateforme.tsx b/packages/site/app/outil-numerique/QuestionsPlateforme.tsx
index 14fe6ed1d8..bf41d4a148 100644
--- a/packages/site/app/outil-numerique/QuestionsPlateforme.tsx
+++ b/packages/site/app/outil-numerique/QuestionsPlateforme.tsx
@@ -2,7 +2,7 @@
import Markdown from '@tet/site/components/markdown/Markdown';
import Section from '@tet/site/components/sections/Section';
-import { Button } from '@tet/ui';
+import { Button, useEventTracker } from '@tet/ui';
type QuestionsPlateformeProps = {
titre: string;
@@ -17,6 +17,8 @@ const QuestionsPlateforme = ({
cta_faq,
cta_contact,
}: QuestionsPlateformeProps) => {
+ const tracker = useEventTracker('site/outil-numerique');
+
return (
{titre}
@@ -34,6 +36,7 @@ const QuestionsPlateforme = ({
tracker('contact_plateforme', {})}
variant="outlined"
className="!bg-[#FFE8BD] hover:!bg-[#FFE4A8]"
>
diff --git a/packages/site/app/outil-numerique/Trajectoire.tsx b/packages/site/app/outil-numerique/Trajectoire.tsx
index e17cda7b65..5e87d03c2f 100644
--- a/packages/site/app/outil-numerique/Trajectoire.tsx
+++ b/packages/site/app/outil-numerique/Trajectoire.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Button } from '@tet/ui';
+import { Button, useEventTracker } from '@tet/ui';
import Section from '@tet/site/components/sections/Section';
import { StrapiItem } from '@tet/site/src/strapi/StrapiItem';
import { StrapiImage } from '@tet/site/components/strapiImage/StrapiImage';
@@ -14,6 +14,8 @@ type TrajectoireProps = {
};
const Trajectoire = ({ titre, description, cta, image }: TrajectoireProps) => {
+ const tracker = useEventTracker('site/outil-numerique');
+
return (
{
texte={description}
className="paragraphe-primary-10 paragraphe-18 markdown_style colored_marker"
/>
-
+ tracker('decouvrir_trajectoire', {})}
+ className="mt-6 max-lg:mx-auto"
+ >
{cta}
diff --git a/packages/site/app/outil-numerique/page.tsx b/packages/site/app/outil-numerique/page.tsx
index b21b45bd62..3d478f9c74 100644
--- a/packages/site/app/outil-numerique/page.tsx
+++ b/packages/site/app/outil-numerique/page.tsx
@@ -11,6 +11,7 @@ import { Metadata, ResolvingMetadata } from 'next';
import { getUpdatedMetadata } from '@tet/site/src/utils/getUpdatedMetadata';
import PanierActionsImpact from './PanierActionsImpact';
import Trajectoire from '@tet/site/app/outil-numerique/Trajectoire';
+import { TrackPageView } from '@tet/ui';
export async function generateMetadata(
{ params }: { params: unknown },
@@ -30,26 +31,32 @@ export async function generateMetadata(
const OutilNumerique = async () => {
const strapiData = await getStrapiData();
- return strapiData ? (
-
-
+ return (
+ <>
+
-
+ {strapiData ? (
+
+
-
+
-
+
- {strapiData.temoignages.length > 0 && (
-
- )}
+
+
+ {strapiData.temoignages.length > 0 && (
+
+ )}
-
+
-
-
- ) : (
-
+
+
+ ) : (
+
+ )}
+ >
);
};
diff --git a/packages/site/app/page.tsx b/packages/site/app/page.tsx
index 7eb57762b9..69051c9c99 100644
--- a/packages/site/app/page.tsx
+++ b/packages/site/app/page.tsx
@@ -9,28 +9,35 @@ import DemandeContact from './DemandeContact';
import Communaute from './Communaute';
import Objectifs from './Objectifs';
import { getData } from './utils';
+import { TrackPageView } from '@tet/ui';
const Accueil = async () => {
const data = await getData();
- return data ? (
+ return (
<>
-
+
-
+ {data ? (
+ <>
+
-
+
-
+
-
+
- {data.temoignages && }
+
-
+ {data.temoignages && }
+
+
+ >
+ ) : (
+
+ )}
>
- ) : (
-
);
};
diff --git a/packages/site/app/programme/CollectivitesEngagees.tsx b/packages/site/app/programme/CollectivitesEngagees.tsx
index 1ef846352b..ca1e16553a 100644
--- a/packages/site/app/programme/CollectivitesEngagees.tsx
+++ b/packages/site/app/programme/CollectivitesEngagees.tsx
@@ -1,7 +1,7 @@
'use client';
import Section from '@tet/site/components/sections/Section';
-import { Button } from '@tet/ui';
+import { Button, useEventTracker } from '@tet/ui';
import {
useCollectivitesEngagees,
useTerritoiresCOT,
@@ -17,6 +17,7 @@ const CollectivitesEngagees = ({ titre, cta }: CollectivitesEngageesProps) => {
const { data: cot } = useTerritoiresCOT('', '');
const { data: labellises } = useTerritoiresLabellises('', '');
const { data: engages } = useCollectivitesEngagees('', '');
+ const tracker = useEventTracker('site/programme');
return (
@@ -52,7 +53,11 @@ const CollectivitesEngagees = ({ titre, cta }: CollectivitesEngageesProps) => {
-
+ tracker('voir_collectivites', {})}
+ >
{cta}
diff --git a/packages/site/app/programme/Compte.tsx b/packages/site/app/programme/Compte.tsx
index 42417db3f2..16bdc31524 100644
--- a/packages/site/app/programme/Compte.tsx
+++ b/packages/site/app/programme/Compte.tsx
@@ -3,7 +3,7 @@
import Markdown from '@tet/site/components/markdown/Markdown';
import Section from '@tet/site/components/sections/Section';
import { StrapiImage } from '@tet/site/components/strapiImage/StrapiImage';
-import { Button } from '@tet/ui';
+import { Button, useEventTracker } from '@tet/ui';
import Arrow from '@tet/site/app/outil-numerique/Arrow';
import { useEvolutionTotalActivation } from '@tet/site/app/stats/EvolutionTotalActivationParType';
import { StrapiItem } from '@tet/site/src/strapi/StrapiItem';
@@ -18,6 +18,7 @@ type CompteProps = {
const Compte = ({ titre, description, cta, image }: CompteProps) => {
const { data } = useEvolutionTotalActivation('', '');
const collectivitesActivees = data ? data.courant.total : undefined;
+ const tracker = useEventTracker('site/programme');
return (
@@ -38,6 +39,7 @@ const Compte = ({ titre, description, cta, image }: CompteProps) => {
/>
tracker('inscription_plateforme', {})}
className="mt-8 max-lg:mx-auto"
external
>
diff --git a/packages/site/app/programme/Contact.tsx b/packages/site/app/programme/Contact.tsx
index b01d30c413..fcc4d071c2 100644
--- a/packages/site/app/programme/Contact.tsx
+++ b/packages/site/app/programme/Contact.tsx
@@ -1,7 +1,7 @@
'use client';
import Section from '@tet/site/components/sections/Section';
-import { Button } from '@tet/ui';
+import { Button, useEventTracker } from '@tet/ui';
type ContactProps = {
description: string;
@@ -9,6 +9,8 @@ type ContactProps = {
};
const Contact = ({ description, cta }: ContactProps) => {
+ const tracker = useEventTracker('site/programme');
+
return (
{
{description}
tracker('contact_programme', {})}
variant="secondary"
className="!bg-[#FFE8BD] !border-[#FFE8BD] !text-primary-7 hover:!text-primary-8"
>
diff --git a/packages/site/app/programme/Etapes.tsx b/packages/site/app/programme/Etapes.tsx
index 5eb2477cde..db2b783908 100644
--- a/packages/site/app/programme/Etapes.tsx
+++ b/packages/site/app/programme/Etapes.tsx
@@ -4,7 +4,7 @@ import Card from '@tet/site/components/cards/Card';
import CardsWrapper from '@tet/site/components/cards/CardsWrapper';
import CardsSection from '@tet/site/components/sections/CardsSection';
import { Content } from './types';
-import { Button } from '@tet/ui';
+import { Button, useEventTracker } from '@tet/ui';
type EtapesProps = {
titre: string;
@@ -13,6 +13,8 @@ type EtapesProps = {
};
const Etapes = ({ titre, contenu, cta }: EtapesProps) => {
+ const tracker = useEventTracker('site/programme');
+
return contenu && contenu.length ? (
{
}
>
-
+ tracker('demarrer_programme', {})}
+ className="mt-3 lg:mt-6 mx-auto"
+ >
{cta}
diff --git a/packages/site/app/programme/page.tsx b/packages/site/app/programme/page.tsx
index ff530cd85d..412a827dee 100644
--- a/packages/site/app/programme/page.tsx
+++ b/packages/site/app/programme/page.tsx
@@ -11,6 +11,7 @@ import { getUpdatedMetadata } from '@tet/site/src/utils/getUpdatedMetadata';
import Contact from './Contact';
import Compte from './Compte';
import CollectivitesEngagees from './CollectivitesEngagees';
+import { TrackPageView } from '@tet/ui';
export async function generateMetadata(
params: { params: unknown },
@@ -30,28 +31,34 @@ export async function generateMetadata(
const Programme = async () => {
const data = await getStrapiData();
- return data ? (
+ return (
<>
-
+
-
+ {data ? (
+ <>
+
-
+
-
+
-
+
-
+
-
+
+
+
+ >
+ ) : (
+
+ )}
>
- ) : (
-
);
};
diff --git a/packages/ui/src/components/tracking/trackingPlan.ts b/packages/ui/src/components/tracking/trackingPlan.ts
index cb63b888dc..d727049d4e 100644
--- a/packages/ui/src/components/tracking/trackingPlan.ts
+++ b/packages/ui/src/components/tracking/trackingPlan.ts
@@ -82,10 +82,10 @@ type IndicateursFiltres = {
export interface TrackingPlan extends Record {
/** Page "Tous les indicateurs" */
'app/indicateurs/tous': {
- properties: {collectivite_id: number};
+ properties: { collectivite_id: number };
onglets: never;
events: {
- toggle_graphique: {actif: boolean};
+ toggle_graphique: { actif: boolean };
filtres: {
filtreValues: IndicateursFiltres;
};
@@ -94,7 +94,7 @@ export interface TrackingPlan extends Record {
/** Page "Indicateurs de la collectivité" */
'app/indicateurs/collectivite': {
- properties: {collectivite_id: number};
+ properties: { collectivite_id: number };
onglets: never;
events: {
explorerIndicateursClick: {};
@@ -183,7 +183,7 @@ export interface TrackingPlan extends Record {
/** Page fiche action */
'app/fiche-action': {
- properties: {collectivite_id: number};
+ properties: { collectivite_id: number };
onglets: never;
events: {
validation_modale_modifier_fa: {};
@@ -218,9 +218,9 @@ export interface TrackingPlan extends Record {
};
onglets: 'emissions_ges' | 'consommations_finales';
events: {
- cta_lancer_calcul: {source: 'open_data' | 'collectivite'};
- cta_download: {file: 'modele' | 'donnees' | 'methodo'};
- selection_secteur: {secteur: string};
+ cta_lancer_calcul: { source: 'open_data' | 'collectivite' };
+ cta_download: { file: 'modele' | 'donnees' | 'methodo' };
+ selection_secteur: { secteur: string };
};
};
@@ -324,4 +324,52 @@ export interface TrackingPlan extends Record {
};
};
};
+
+ /** Tracking du site */
+
+ /* Page d'accueil du site */
+ 'site/accueil': {
+ properties: {};
+ onglets: never;
+ events: {
+ decouvrir_programme: {};
+ decouvrir_plateforme: {};
+ demande_contact: {};
+ inscription_newsletter: {};
+ };
+ };
+
+ /* Page programme du site */
+ 'site/programme': {
+ properties: {};
+ onglets: never;
+ events: {
+ contact_programme: {};
+ demarrer_programme: {};
+ inscription_plateforme: {};
+ voir_collectivites: {};
+ };
+ };
+
+ /* Page outil numérique du site */
+ 'site/outil-numerique': {
+ properties: {};
+ onglets: never;
+ events: {
+ inscription_plateforme: {};
+ inscription_demo: {};
+ decouvrir_pai: {};
+ decouvrir_trajectoire: {};
+ contact_plateforme: {};
+ };
+ };
+
+ /* Page contact du site */
+ 'site/contact': {
+ properties: {};
+ onglets: never;
+ events: {
+ envoyer_message: {};
+ };
+ };
}