WS-3071: Resolve Piano vs Optimizely View Count Discrepancy for Account Promotional Banner Experiment - #14268
Open
elvinasv wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to resolve the Piano vs Optimizely view-count discrepancy for the WS account promotional banner experiment by ensuring view events and experiment activation are gated consistently with when the banner can actually be shown.
Changes:
- Gate Optimizely experiment activation behind server-knowable eligibility to avoid activating for ineligible users.
- Gate the control arm’s view tracking behind client-side banner visibility to mirror the “on” arm’s suppression behavior.
- Centralise banner eligibility logic into a shared hook and introduce a client-side visibility hook mirroring the inline script logic.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/lib/uasApi/tokenRefresh/tokenManager.ts | Minor formatting change (blank line) in token validation helper. |
| src/app/components/Account/AccountPromotionalBannerExperiment/index.tsx | Adds eligibility gating for activation and visibility gating for control view tracking to align experiment arms. |
| src/app/components/Account/AccountPromotionalBanner/useIsAccountPromoBannerVisible/index.ts | New hook to compute banner visibility client-side (localStorage/cookie-based) for control-arm view gating. |
| src/app/components/Account/AccountPromotionalBanner/useAccountPromoBannerEligibility/index.ts | New shared hook encapsulating server-knowable eligibility checks for banner/experiment. |
| src/app/components/Account/AccountPromotionalBanner/index.tsx | Refactors banner to use shared eligibility hook (removing duplicated inline eligibility checks). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves JIRA: https://bbc.atlassian.net/browse/WS-3071
Summary
A very high-level summary of easily-reproducible changes that can be understood by non-devs, and why these changes where made.
Code changes
Testing
Useful Links