Corrige les custom variables pour le tracking

pull/1424/head
Johan Girod 2021-02-18 15:35:36 +01:00
parent c9504a92c7
commit 0f6e45dace
2 changed files with 8 additions and 8 deletions

View File

@ -12,7 +12,7 @@ export const INDICATOR = {
type CustomSiteIndicator = {
[INDICATOR.SITE.LANGAGE]: '[fr]' | '[en]' // langage du site (mycompanyinfrance ou mon-entreprise)
[INDICATOR.SITE.EMBARQUÉ]: 1 | 0 // intégration externe
[INDICATOR.SITE.EMBARQUÉ]: '1' | '0' // intégration externe
}
type CustomPageIndicator = Record<string, string>
@ -76,9 +76,14 @@ export function createTracker(siteId?: string) {
this.customVars.set({
site: {
[INDICATOR.SITE.LANGAGE]: `[${options.language}]` as '[fr]' | '[en]',
[INDICATOR.SITE.EMBARQUÉ]: 0,
[INDICATOR.SITE.EMBARQUÉ]: document.location.pathname.includes(
'/iframes/'
)
? '1'
: '0',
},
})
this.dispatch()
}
}
return Tag

View File

@ -1,18 +1,13 @@
import { IsEmbeddedContext } from 'Components/utils/embeddedContext'
import { useContext } from 'react'
import { Helmet } from 'react-helmet'
import { Route, Switch } from 'react-router-dom'
import { TrackingContext } from '../../ATInternetTracking'
import { INDICATOR } from '../../ATInternetTracking/Tracker'
import useSimulatorsData from '../Simulateurs/metadata'
import SimulateurPage from '../Simulateurs/Page'
import IframeFooter from './IframeFooter'
export default function Iframes() {
const simulators = useSimulatorsData()
useContext(TrackingContext).customVars.set({
site: { [INDICATOR.SITE.EMBARQUÉ]: 1 },
})
return (
<IsEmbeddedContext.Provider value={true}>
{/** Open external links in the parent frame.