Skip to content

Commit

Permalink
Merge pull request #87 from SocialGouv/fix-trackers
Browse files Browse the repository at this point in the history
fix: trackers
  • Loading branch information
alebret authored Sep 19, 2022
2 parents 3592988 + 1213ddb commit 676f142
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ export default function Home() {

const startSurvey = () => {
trackerClick(CATEG.home, EVENT_CLICK, `Commencer le test - ${source}`)
DemographicDataUtils.trackerForDemographie("Home - Commencer")
localStorage.setItem(STORAGE_SOURCE, source)

localStorage.setItem(STORAGE_TEST_ABC, AbTestingUtils.generateRandomTest())
DemographicDataUtils.trackerForDemographie("Home - Commencer")
goToBeforeSurvey()
}

Expand Down
16 changes: 3 additions & 13 deletions src/utils/ab-testing/measuring-intentions.utils.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import {
STORAGE_TEST_ABC,
STORAGE_TEST_VERS_QUI_SE_TOURNER,
} from "../../constants/constants"
import { STORAGE_TEST_VERS_QUI_SE_TOURNER } from "../../constants/constants"
import { getColorIconAndTextByMood } from "../main.utils"
import {
SCORE_LEVEL_BAD,
SCORE_LEVEL_GOOD,
SCORE_LEVEL_MEDIUM,
} from "../score-level.utils"
import { ACTION, CATEG, trackerClick } from "../tracker.utils"
import { CATEG, trackerClick } from "../tracker.utils"
import { TEST } from "./ab-testing.utils"
import * as StorageUtils from "../storage.utils"

export const contacterAToutMoment =
"Sachez qu’à tout moment vous pouvez contacter Elise."
Expand Down Expand Up @@ -147,14 +143,8 @@ export const estProcheDeLaRealiteCommentaireByScoreLevel = (scoreLevel) => {
}

export const trackerForIntentions = (scoreLevel, label) => {
const testId = StorageUtils.getInLocalStorage(STORAGE_TEST_ABC)
const moodLevel = getColorIconAndTextByMood(scoreLevel).moodText

trackerClick(
CATEG.test,
`${ACTION.parcours}${testId}`,
`${moodLevel} - ${label}`
)
trackerClick(CATEG.intentions, moodLevel, label)
}

export const saveIsIntentionVersQuiSeTourner = (label) => {
Expand Down
1 change: 1 addition & 0 deletions src/utils/tracker.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const CATEG = {
home: "Home",
survey: "Questionnaire",
test: "Test",
intentions: "Intentions",
}

export const ACTION = {
Expand Down

0 comments on commit 676f142

Please sign in to comment.