📈 ajoute le tracking de la satisfaction
parent
cbaa3246ec
commit
e14b0c0334
|
@ -0,0 +1,2 @@
|
|||
ignorePatterns:
|
||||
- smarttag.js
|
|
@ -1,8 +1,5 @@
|
|||
import './smarttag.js'
|
||||
|
||||
type CustomPageObject = {}
|
||||
type CustomHitObject = {}
|
||||
|
||||
// Ci-dessous les indicateurs personnalisés de site et de page
|
||||
// https://developers.atinternet-solutions.com/javascript-fr/contenus-javascript-fr/indicateurs-de-site-et-de-page-javascript-fr/
|
||||
export const INDICATOR = {
|
||||
|
@ -17,7 +14,7 @@ type CustomSiteIndicator = {
|
|||
[INDICATOR.SITE.LANGAGE]: '[fr]' | '[en]' // langage du site (mycompanyinfrance ou mon-entreprise)
|
||||
[INDICATOR.SITE.EMBARQUÉ]: 1 | 0 // intégration externe
|
||||
}
|
||||
type CustomPageIndicator = {}
|
||||
type CustomPageIndicator = Record<string, string>
|
||||
|
||||
type ATHit = {
|
||||
name?: string
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,6 +2,7 @@ import { TrackerContext } from 'Components/utils/withTracker'
|
|||
import React, { useCallback, useContext, useState } from 'react'
|
||||
import { Trans } from 'react-i18next'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { TrackingContext } from '../../ATInternetTracking'
|
||||
import safeLocalStorage from '../../storage/safeLocalStorage'
|
||||
import './Feedback.css'
|
||||
import Form from './FeedbackForm'
|
||||
|
@ -42,6 +43,7 @@ export default function PageFeedback({
|
|||
location.pathname,
|
||||
]),
|
||||
})
|
||||
const ATTracker = useContext(TrackingContext)
|
||||
|
||||
const handleFeedback = useCallback(({ useful }: { useful: boolean }) => {
|
||||
tracker.push([
|
||||
|
@ -50,6 +52,10 @@ export default function PageFeedback({
|
|||
useful ? 'positive rating' : 'negative rating',
|
||||
location.pathname,
|
||||
])
|
||||
ATTracker.click.send({
|
||||
chapter1: 'satisfaction',
|
||||
name: useful ? 'positive' : 'negative',
|
||||
})
|
||||
const feedback = [
|
||||
customEventName || 'rate page usefulness',
|
||||
location.pathname,
|
||||
|
|
|
@ -31,7 +31,7 @@ export default function PercentageField({
|
|||
debouncedOnChange(value)
|
||||
}}
|
||||
type="range"
|
||||
value={localValue as number}
|
||||
value={localValue}
|
||||
name="volume"
|
||||
min="0"
|
||||
step="0.05"
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { setSimulationConfig } from 'Actions/actions'
|
||||
import { useEffect } from 'react'
|
||||
import { useDispatch, useSelector } from 'react-redux'
|
||||
import { useHistory } from 'react-router'
|
||||
import { Company } from 'Reducers/inFranceAppReducer'
|
||||
|
@ -25,11 +24,9 @@ export default function useSimulationConfig(
|
|||
: undefined
|
||||
|
||||
const lastConfig = useSelector(configSelector)
|
||||
useEffect(() => {
|
||||
if (config && lastConfig !== config) {
|
||||
dispatch(setSimulationConfig(config ?? {}, url, initialSituation))
|
||||
}
|
||||
}, [config, initialSituation])
|
||||
if (config && lastConfig !== config) {
|
||||
dispatch(setSimulationConfig(config ?? {}, url, initialSituation))
|
||||
}
|
||||
}
|
||||
|
||||
export function getCompanySituation(company: Company | null): Situation {
|
||||
|
|
|
@ -776,12 +776,8 @@ export function getSimulatorsData({
|
|||
},
|
||||
pamc: {
|
||||
private: true,
|
||||
tracking: {
|
||||
chapter2: 'profession_liberale',
|
||||
chapter3: 'pamc',
|
||||
name: 'accueil',
|
||||
},
|
||||
iframe: 'pamc',
|
||||
tracking: {},
|
||||
title: t(
|
||||
'pages.simulateurs.pamc.title',
|
||||
|
||||
|
@ -805,6 +801,7 @@ export function getSimulatorsData({
|
|||
},
|
||||
'aides-embauche': {
|
||||
icône: '🎁',
|
||||
tracking: 'aides_embauche',
|
||||
meta: {
|
||||
title: 'Aides à l’embauche',
|
||||
description:
|
||||
|
@ -848,9 +845,8 @@ export function getSimulatorsData({
|
|||
},
|
||||
is: {
|
||||
icône: '🗓',
|
||||
tracking: {
|
||||
name: 'impot-societe',
|
||||
},
|
||||
tracking: 'impot-societe',
|
||||
|
||||
path: sitePaths.simulateurs.is,
|
||||
iframe: 'impot-societe',
|
||||
meta: {
|
||||
|
|
|
@ -13,7 +13,7 @@ const localStorageKey = (pathname: string) =>
|
|||
|
||||
export function setupSimulationPersistence(
|
||||
store: Store<RootState, Action>,
|
||||
debounceDelay: number = 1000
|
||||
debounceDelay = 1000
|
||||
) {
|
||||
const listener = () => {
|
||||
const state = store.getState()
|
||||
|
|
Loading…
Reference in New Issue