Skip to content

WS-3071: Resolve Piano vs Optimizely View Count Discrepancy for Account Promotional Banner Experiment - #14268

Open
elvinasv wants to merge 5 commits into
latestfrom
WS-3071-resolve-piano-vs-optimizely-view-count-discrepancy-for-account-promotional-banner-experiment
Open

WS-3071: Resolve Piano vs Optimizely View Count Discrepancy for Account Promotional Banner Experiment#14268
elvinasv wants to merge 5 commits into
latestfrom
WS-3071-resolve-piano-vs-optimizely-view-count-discrepancy-for-account-promotional-banner-experiment

Conversation

@elvinasv

Copy link
Copy Markdown
Member

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

  • List key code changes that have been made.

Testing

  1. List the steps required to test this PR.

Useful Links

@elvinasv
elvinasv marked this pull request as ready for review July 28, 2026 12:41
Copilot AI review requested due to automatic review settings July 28, 2026 12:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants