Skip to content

Commit

Permalink
Revert "feat: Ajoute le tracking pour la campagne apprentissage (#3363)"
Browse files Browse the repository at this point in the history
This reverts commit 62a2581.
  • Loading branch information
Mintoo200 committed Nov 26, 2024
1 parent d1758c5 commit 9f74dd0
Show file tree
Hide file tree
Showing 22 changed files with 232 additions and 3,658 deletions.
2 changes: 0 additions & 2 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-nocheck

import type { StorybookConfig } from "@storybook/nextjs";
const path = require('path');

Expand Down
8 changes: 3 additions & 5 deletions config/headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ const LOCAL_MODE_HEADERS = [];
const STRAPI_MEDIA_HOST = new URL(process.env.STRAPI_MEDIA_URL).hostname;
const TRUSTED_SOURCES = '*.fabrique.social.gouv.fr *.meilisearch.io/multi-search *.meilisearch.com/multi-search 1j1s-front.osc-fr1.scalingo.io *.1jeune1solution.gouv.fr';
const ANALYTICS_SOURCES = `${process.env.NEXT_PUBLIC_ANALYTICS_DOMAIN} ${process.env.NEXT_PUBLIC_ANALYTICS_MATOMO_HOST}`;
// FIXME (GAFI 16-10-2024): Si on passait par un Record<CSPKeys, string[]>, ça pourrait nous éviter les typos et améliorer la lisibilité
const contentSecurityPolicy = `
default-src 'self' ${TRUSTED_SOURCES};
script-src 'self' ${ANALYTICS_SOURCES} https://*.adform.net www.googletagmanager.com analytics.tiktok.com *.adnxs.com *.adsrvr.org *.facebook.com *.facebook.net;
img-src 'self' *.google.com data: ${STRAPI_MEDIA_HOST} ${ANALYTICS_SOURCES} img.youtube.com jedonnemonavis.numerique.gouv.fr *.adnxs.com *.adsrvr.org *.doubleclick.net p1.zemanta.com *.facebook.com;
script-src 'self' ${ANALYTICS_SOURCES} https://*.adform.net;
img-src 'self' *.google.com data: ${STRAPI_MEDIA_HOST} ${ANALYTICS_SOURCES} img.youtube.com jedonnemonavis.numerique.gouv.fr;
style-src 'self' 'unsafe-inline' ${ANALYTICS_SOURCES};
frame-ancestors 'none';
frame-src 'self' *.apprentissage.beta.gouv.fr immersion-facile.beta.gouv.fr deposer-offre.www.1jeune1solution.gouv.fr *.youtube-nocookie.com simulateur-alternance.1jeune1solution.gouv.fr https://*.adform.net mes-aides.francetravail.fr *.doubleclick.net *.adsrvr.org;
frame-src 'self' *.apprentissage.beta.gouv.fr immersion-facile.beta.gouv.fr deposer-offre.www.1jeune1solution.gouv.fr *.youtube-nocookie.com simulateur-alternance.1jeune1solution.gouv.fr https://*.adform.net mes-aides.francetravail.fr;
form-action 'self';
base-uri 'none';
connect-src 'self' ${TRUSTED_SOURCES} analytics.tiktok.com *.facebook.com *.adnxs.com;
`;

const SECURITY_MODE_HEADERS = [{
Expand Down
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/basic-features/typescript for more information.
3,387 changes: 201 additions & 3,186 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions public/scripts/tarteaucitron/lang/tarteaucitron.fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ tarteaucitron.lang = {
acceptAll: 'Tout accepter',
adblock: 'Bonjour! Ce site joue la transparence et vous donne le choix des services tiers à activer.',
adblock_call: 'Merci de désactiver votre adblocker pour commencer la personnalisation.',
adform: '<p><span style="font-weight: bold; display: inline">Finalité</span> : Les campagnes d’informations gouvernementales permettent le partage d’informations utiles diffusées dans le cadre de grandes campagnes d’information, ou en cas de crise. Dans le détail : le traceur AdForm contient des cookies provenant de la régie Adform.</p><p><span style="font-weight: bold; display: inline">Conséquences en cas de refus</span> : En cas de refus, vos visites sur les pages concernés ne sont pas comptabilisés dans les statistiques de suivi de campagne.</p><p><span style="font-weight: bold; display: inline">Consentement</span> : Oui nécessaire</p><p><span style="font-weight: bold; display: inline">Durée de conservation</span> : 13 mois</p>',
adform: '<p><span style="font-weight: bold; display: inline">Finalité</span> : Les campagnes d’informations gouvernementales permettent le partage d’informations utiles diffusées dans le cadre de grandes campagnes d’information, ou en cas de crise. Dans le détail : le traceur AdForm contient des cookies provenant des régies Amnet, Seedtag, Yahoo, Snapchhat, Meta, Tiktok.</p><p><span style="font-weight: bold; display: inline">Conséquences en cas de refus</span> : En cas de refus, vos visites sur les pages concernés ne sont pas comptabilisés dans les statistiques de suivi de campagne.</p><p><span style="font-weight: bold; display: inline">Consentement</span> : Oui nécessaire</p><p><span style="font-weight: bold; display: inline">Durée de conservation</span> : 13 mois</p>',
alertBig: 'vous acceptez l‘utilisation de services tiers pouvant installer des cookies',
alertBigClick: 'En poursuivant votre navigation,',
alertBigPrivacy: 'Ce site utilise des cookies et vous donne le contrôle sur ceux que vous souhaitez activer',
// FIXME (GAFI 08-10-2024): Renomme juste la catégorie Ads avec les infos des campagnes ...
ads: {
details: 'Les campagnes d’informations gouvernementales permettent le partage d’informations utiles diffusées dans le cadre de grandes campagnes d’information, ou en cas de crise.',
title: 'Campagnes d’informations gouvernementales',
Expand Down Expand Up @@ -74,13 +73,6 @@ tarteaucitron.lang = {
useCookieCurrent: 'Ce service a déposé',
useNoCookie: 'Ce service n‘a déposé aucun cookie.',
youtube: '<p><span style="font-weight: bold; display: inline">Finalité</span> : Les services de vidéo permettent d’enrichir le site de contenu multimédia et augmentent sa visibilité. Ces traceurs sont mis en œuvre par Google.</p><p><span style="font-weight: bold; display: inline">Conséquences en cas de refus</span> : En cas de refus, vous ne pouvez pas visualiser les vidéos sur le site. </p><p><span style="font-weight: bold; display: inline">Consentement</span> : Oui nécessaire</p><p><span style="font-weight: bold; display: inline">Durée de conservation</span> : 13 mois </p>',
adsrvr: '<p><span style="font-weight: bold; display: inline">Finalité</span> : Les campagnes d’informations gouvernementales permettent le partage d’informations utiles diffusées dans le cadre de grandes campagnes d’information, ou en cas de crise. Dans le détail : le traceur Adsrvr est utilisé par la régie Amnet.</p><p><span style="font-weight: bold; display: inline">Conséquences en cas de refus</span> : En cas de refus, vos visites sur les pages concernés ne sont pas comptabilisés dans les statistiques de suivi de campagne.</p><p><span style="font-weight: bold; display: inline">Consentement</span> : Oui nécessaire</p><p><span style="font-weight: bold; display: inline">Durée de conservation</span> : 13 mois</p>',
xandr: '<p><span style="font-weight: bold; display: inline">Finalité</span> : Les campagnes d’informations gouvernementales permettent le partage d’informations utiles diffusées dans le cadre de grandes campagnes d’information, ou en cas de crise. Dans le détail : le traceur Xandr est utilisé par la régie Amnet.</p><p><span style="font-weight: bold; display: inline">Conséquences en cas de refus</span> : En cas de refus, vos visites sur les pages concernés ne sont pas comptabilisés dans les statistiques de suivi de campagne.</p><p><span style="font-weight: bold; display: inline">Consentement</span> : Oui nécessaire</p><p><span style="font-weight: bold; display: inline">Durée de conservation</span> : 13 mois</p>',
'amnet-outbrain': '<p><span style="font-weight: bold; display: inline">Finalité</span> : Les campagnes d’informations gouvernementales permettent le partage d’informations utiles diffusées dans le cadre de grandes campagnes d’information, ou en cas de crise. Dans le détail : le traceur Outbrain DSP est utilisé par la régie Amnet.</p><p><span style="font-weight: bold; display: inline">Conséquences en cas de refus</span> : En cas de refus, vos visites sur les pages concernés ne sont pas comptabilisés dans les statistiques de suivi de campagne.</p><p><span style="font-weight: bold; display: inline">Consentement</span> : Oui nécessaire</p><p><span style="font-weight: bold; display: inline">Durée de conservation</span> : 13 mois</p>',
seedtag: '<p><span style="font-weight: bold; display: inline">Finalité</span> : Les campagnes d’informations gouvernementales permettent le partage d’informations utiles diffusées dans le cadre de grandes campagnes d’information, ou en cas de crise. Dans le détail : le traceur Googletagmanager est utilisé par la régie Seedtag.</p><p><span style="font-weight: bold; display: inline">Conséquences en cas de refus</span> : En cas de refus, vos visites sur les pages concernés ne sont pas comptabilisés dans les statistiques de suivi de campagne.</p><p><span style="font-weight: bold; display: inline">Consentement</span> : Oui nécessaire</p><p><span style="font-weight: bold; display: inline">Durée de conservation</span> : 13 mois</p>',
azerion: '<p><span style="font-weight: bold; display: inline">Finalité</span> : Les campagnes d’informations gouvernementales permettent le partage d’informations utiles diffusées dans le cadre de grandes campagnes d’information, ou en cas de crise. Dans le détail : le traceur Azerion est utilisé par la régie Azerion.</p><p><span style="font-weight: bold; display: inline">Conséquences en cas de refus</span> : En cas de refus, vos visites sur les pages concernés ne sont pas comptabilisés dans les statistiques de suivi de campagne.</p><p><span style="font-weight: bold; display: inline">Consentement</span> : Oui nécessaire</p><p><span style="font-weight: bold; display: inline">Durée de conservation</span> : 13 mois</p>',
tiktok: '<p><span style="font-weight: bold; display: inline">Finalité</span> : Les campagnes d’informations gouvernementales permettent le partage d’informations utiles diffusées dans le cadre de grandes campagnes d’information, ou en cas de crise. Dans le détail : le traceur Tiktok est utilisé par la régie Tiktok.</p><p><span style="font-weight: bold; display: inline">Conséquences en cas de refus</span> : En cas de refus, vos visites sur les pages concernés ne sont pas comptabilisés dans les statistiques de suivi de campagne.</p><p><span style="font-weight: bold; display: inline">Consentement</span> : Oui nécessaire</p><p><span style="font-weight: bold; display: inline">Durée de conservation</span> : 13 mois</p>',
meta: '<p><span style="font-weight: bold; display: inline">Finalité</span> : Les campagnes d’informations gouvernementales permettent le partage d’informations utiles diffusées dans le cadre de grandes campagnes d’information, ou en cas de crise. Dans le détail : le traceur Facebook est utilisé par la régie Meta.</p><p><span style="font-weight: bold; display: inline">Conséquences en cas de refus</span> : En cas de refus, vos visites sur les pages concernés ne sont pas comptabilisés dans les statistiques de suivi de campagne.</p><p><span style="font-weight: bold; display: inline">Consentement</span> : Oui nécessaire</p><p><span style="font-weight: bold; display: inline">Durée de conservation</span> : 13 mois</p>',
video: {
details: 'Les services de partage de vidéo permettent d‘enrichir le site de contenu multimédia et augmentent sa visibilité.',
title: 'Vidéos',
Expand Down
33 changes: 8 additions & 25 deletions public/scripts/tarteaucitron/tarteaucitron.services.js
Original file line number Diff line number Diff line change
Expand Up @@ -1257,10 +1257,10 @@ tarteaucitron.services.xandr = {
});
},
key: 'xandr',
name: 'Amnet - Xandr',
name: 'Xandr (Universal)',
needConsent: true,
type: 'ads',
uri: 'https://support.google.com/displayvideo/topic/3528231?hl=en&ref_topic=9059505&sjid=9933903973918710720-EU',
uri: 'https://www.xandr.com/privacy/cookie-policy/',
};

// xandr segment
Expand Down Expand Up @@ -5984,28 +5984,11 @@ tarteaucitron.services.outbrain = {
cookies: [],
js: function () {
'use strict';
if (tarteaucitron.user.zemTagId == null) {
return;
}
if (window.zemApi) {
return;
}
var api = window.zemApi = function() {
api.dispatch ? api.dispatch.apply(api, arguments) : api.queue.push(arguments);
};
api.version = '1.0';
api.loaded = true;
api.marketerId = [tarteaucitron.user.zemTagId];
document.addEventListener('navigate', () => {
api.marketerId = []
})
api.queue = [];
tarteaucitron.addScript('//js-tag.zemanta.com/zcpt.js', undefined,function() {
window.zemApi('track', 'PAGE_VIEW');
}, undefined, 'defer', 'true');

tarteaucitron.addScript('https://widgets.outbrain.com/outbrain.js');
},
key: 'outbrain',
name: 'Amnet - Outbrain',
name: 'Outbrain',
needConsent: true,
type: 'ads',
uri: 'https://www.outbrain.com/fr/advertisers/guidelines/',
Expand Down Expand Up @@ -6349,7 +6332,7 @@ tarteaucitron.services.weborama = {

// tiktok
tarteaucitron.services.tiktok = {
cookies: ['_tt_enable_cookie', '_ttp'],
cookies: [],
js: function () {
'use strict';

Expand All @@ -6366,8 +6349,8 @@ tarteaucitron.services.tiktok = {
key: 'tiktok',
name: 'Tiktok',
needConsent: true,
type: 'ads',
uri: 'https://www.tiktok.com/legal/page/global/cookie-policy/fr',
type: 'analytic',
uri: 'https://www.tiktok.com/legal/tiktok-website-cookies-policy',
};

// Klaviyo
Expand Down
20 changes: 0 additions & 20 deletions src/client/dependencies.container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,8 @@ import { BffLocalisationService } from '~/client/services/localisation/bff.local
import { LocalisationService } from '~/client/services/localisation/localisation.service';
import { LoggerService } from '~/client/services/logger.service';
import { AdformMarketingService } from '~/client/services/marketing/adform/adform.marketing.service';
import AmnetMarketingService from '~/client/services/marketing/amnet/amnet.marketing.service';
import AzerionMarketingService from '~/client/services/marketing/azerion/azerion.marketing.service';
import { MarketingService } from '~/client/services/marketing/marketing.service';
import MetaMarketingService from '~/client/services/marketing/meta/meta.marketing.service';
import { NullMarketingService } from '~/client/services/marketing/null/null.marketing.service';
import SeedtagMarketingService from '~/client/services/marketing/seedtag/seedtag.marketing.service';
import TiktokMarketingService from '~/client/services/marketing/TikTok/tiktok.marketing.service';
import { BffAlternanceMetierService } from '~/client/services/metiers/bff.alternance.metier.service';
import { MetierService } from '~/client/services/metiers/metier.service';
import { BffMissionEngagementService } from '~/client/services/missionEngagement/bff.missionEngagement.service';
Expand Down Expand Up @@ -95,11 +90,6 @@ export type Dependencies = {
stageDeposerOffreEtape3PersistenceService: StageDeposerOffreEtape3PersistenceService
localStorageService: StorageService
sessionStorageService: StorageService
seedtagService: MarketingService
tiktokService: MarketingService
azerionService: MarketingService
amnetService: MarketingService
metaService: MarketingService
}

class DependencyInitException extends Error {
Expand Down Expand Up @@ -127,11 +117,6 @@ export default function dependenciesContainer(sessionId?: string): Dependencies
const emploiEuropeService = new BffEmploiEuropeService(httpClientService);
const stageService = new BffStageService(httpClientService);
const cookiesService = getCookieService();
const seedtagService = new SeedtagMarketingService(cookiesService);
const tiktokService = new TiktokMarketingService(cookiesService);
const azerionService = new AzerionMarketingService(cookiesService);
const amnetService = new AmnetMarketingService(cookiesService);
const metaService = new MetaMarketingService(cookiesService);
const marketingService = process.env.NEXT_PUBLIC_CAMPAGNE_ADFORM_FEATURE === '1'
? new AdformMarketingService(cookiesService)
: new NullMarketingService();
Expand Down Expand Up @@ -180,9 +165,7 @@ export default function dependenciesContainer(sessionId?: string): Dependencies
getStorageServiceWithFallback(localStorageService, new NullStorageService()));

return {
amnetService,
analyticsService,
azerionService,
cookiesService,
dateService,
demandeDeContactService,
Expand All @@ -191,19 +174,16 @@ export default function dependenciesContainer(sessionId?: string): Dependencies
localStorageService,
localisationService,
marketingService,
metaService,
metierLbaService,
metierStage3eEt2deService,
missionEngagementService,
rechercheClientService,
seedtagService,
sessionStorageService,
stage3eEt2deService,
stageDeposerOffreEtape1PersistenceService,
stageDeposerOffreEtape2PersistenceService,
stageDeposerOffreEtape3PersistenceService,
stageService,
tiktokService,
youtubeService,
établissementAccompagnementService,
};
Expand Down
1 change: 0 additions & 1 deletion src/client/services/cookies/cookies.service.fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export function aCookiesService(override?: Partial<CookiesService>): CookiesServ
allowService: jest.fn(),
isServiceAllowed: jest.fn(() => true),
openPanel: jest.fn(),
triggerJobs: jest.fn(),
...override,
};
}
2 changes: 0 additions & 2 deletions src/client/services/cookies/cookies.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ export interface CookiesService {
allowService(nom: string): void;

openPanel(): void;

triggerJobs(): void;
}
4 changes: 0 additions & 4 deletions src/client/services/cookies/null/null.cookies.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,4 @@ export class NullCookiesService implements CookiesService {
openPanel(): void {
return;
}

triggerJobs(): void {
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export type TarteAuCitron = {
openPanel: () => void,
}
state: Record<TarteAuCitron.ServiceName, boolean>;
triggerJobsAfterAjaxCall: () => void;
}

export class TarteAuCitronCookiesService implements CookiesService {
Expand Down Expand Up @@ -59,10 +58,7 @@ export class TarteAuCitronCookiesService implements CookiesService {

addService(nom: string, config?: TarteAuCitron.ServiceConfig<unknown>): void {
if (config != undefined) {
this.tarteaucitron.services[nom] = {
...(this.tarteaucitron.services[nom] ?? {}),
...config,
};
this.tarteaucitron.services[nom] = config;
}
this.tarteaucitron.job?.push(nom);
}
Expand All @@ -88,8 +84,4 @@ export class TarteAuCitronCookiesService implements CookiesService {
openPanel(): void {
return this.tarteaucitron.userInterface.openPanel();
}

triggerJobs(): void {
return this.tarteaucitron.triggerJobsAfterAjaxCall();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export function aTarteAuCitron(override?: Partial<TarteAuCitron>): TarteAuCitron
job: undefined,
services: {},
state: {},
triggerJobsAfterAjaxCall: jest.fn(),
user: {},
userInterface: {
openPanel: jest.fn(),
Expand Down
22 changes: 0 additions & 22 deletions src/client/services/marketing/TikTok/tiktok.marketing.service.ts

This file was deleted.

Loading

0 comments on commit 9f74dd0

Please sign in to comment.