feat(recherche): mise en place A/B Testing sur les labels pour les contributions.#7243
feat(recherche): mise en place A/B Testing sur les labels pour les contributions.#7243
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
revu-bot
left a comment
There was a problem hiding this comment.
PR Summary: A/B Testing for Contribution Labels in Search
This PR migrates A/B testing from a custom hand-rolled implementation (initABTesting.ts, useABTestVariant.ts) to the built-in A/B testing support in @socialgouv/matomo-next@1.13.1. The overall direction is positive — removing ~170 lines of custom code in favor of a library-maintained solution.
Key Changes
- Upgrades
@socialgouv/matomo-nextfrom^1.11.0to^1.13.1 - Removes custom
initABTesting.tsanduseABTestVariant.ts - Passes
abTests: AB_TESTSdirectly totrackAppRouter() - Defines a
LabelCardSearchA/B test with 5 variations for contribution labels - Applies the variant in
SearchCardandSearchResultCard
Issues Found
| File | Lines | Severity | Issue |
|---|---|---|---|
abTests.ts |
18–37 | IMPORTANT | percentage: 100 means all visitors are enrolled — no control group |
utils.ts |
39–54 | IMPORTANT | ORIGINAL variant falls through to default label — silent mismatch |
SearchPageClient.test.tsx |
32–34 | IMPORTANT | Mock returns wrong shape for useABTestVariant |
abTests.ts |
18 | MINOR | Test name "LabelCardSearch" is a magic string duplicated across files |
MatomoAnalytics.tsx |
32 | MINOR | SITE_URL import removed but was previously used — verify no regression |
maxgfr
left a comment
There was a problem hiding this comment.
Trop bien 🤩🤩🤩🤩🤩🤩
T'en penses quoi de l'approche ? 👀
Super simple et efficace, le top 👍 Ca a été un jeu d'enfant à mettre en place. |
a9f532b to
3d2674c
Compare
bd8c8ff to
dd6ee08
Compare
|
|
🎉 Deployment for commit dd6ee08 : IngressesDocker images
|



closes #7214