WS-3255: Decouple user id from personalisation - #14361
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Several analytics event paths omit the new state, and SSR can report an incorrect affirmative value.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Adds isPersonalisationOn tracking, derived from personalisation availability and JWT claims, and propagates it through account state and ATI/Reverb analytics.
Changes:
- Extends account, analytics, and browser API types.
- Threads personalisation state through page analytics.
- Updates related tests and fixtures.
| File | Reviewed changes |
|---|---|
src/global.d.ts |
Extends the bbcuser API. |
src/app/pages/ArticlePage/index.test.tsx |
Updates article analytics fixtures. |
src/app/models/types/account.ts |
Adds account context state. |
src/app/lib/analyticsUtils/setBbcPage/index.ts |
Exposes personalisation state globally. |
src/app/contexts/ReverbParamsContext/index.tsx |
Passes state into analytics parameters. |
src/app/contexts/ReverbParamsContext/index.test.tsx |
Updates context expectations. |
src/app/contexts/AccountContext/index.tsx |
Calculates state from toggles and JWT claims. |
src/app/contexts/AccountContext/index.test.tsx |
Tests personalisation enablement. |
src/app/components/ATIAnalytics/types.ts |
Extends analytics types. |
src/app/components/ATIAnalytics/params/index.ts |
Forwards the new parameter. |
src/app/components/ATIAnalytics/params/index.test.ts |
Updates parameter fixtures. |
src/app/components/ATIAnalytics/params/buildParams/index.ts |
Builds parameters with the state. |
src/app/components/ATIAnalytics/params/buildParams/index.test.ts |
Updates builder expectations. |
src/app/components/ATIAnalytics/index.client.test.tsx |
Updates analytics container expectations. |
src/app/components/ATIAnalytics/atiUrl/index.ts |
Adds state to page-view payloads. |
src/app/components/ATIAnalytics/atiUrl/index.client.test.ts |
Updates page-view model tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
vdeksne
approved these changes
Sep 23, 2026
shayneahchoon
approved these changes
Sep 24, 2026
LukasFrm
approved these changes
Sep 25, 2026
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-3255
Summary
This pull request adds support for tracking whether personalisation is enabled for a user in the ATI analytics payloads. It introduces a new
isPersonalisationOnproperty, ensures it is passed through all relevant analytics functions, and updates the tests and types accordingly. Additionally, it determines the value ofisPersonalisationOnbased on user sign-in status, article personalisation availability, and a claim in the user's JWT.Code changes
Personalisation tracking integration:
Added an
isPersonalisationOnproperty to analytics types (ReverbUserVars,ATIPageTrackingProps) and ensured it is included in all analytics payloads and function signatures.Updated all relevant tests to include and expect the new
isPersonalisationOnproperty in analytics objects.Personalisation state determination:
In
AccountContext, added logic to decode the user's JWT and determine if they have opted out of personalisation (based on theepclaim), then setisPersonalisationOnaccordinglyPassed the computed
isPersonalisationOnvalue through the context to downstream consumers.So the logic is:
Reference: https://bbc.atlassian.net/wiki/spaces/DAS/pages/834247434/SPIKE+RVRB-509+-+Reverb+Investigate+approach+for+Decoupling+User+ID+from+Personalisation#Proposal-1:-Orbit/WS/Webcore-should-provide-value-for-isPersonalisationOn-boolean
Signed out & Personalisation ON

SignedIn& Personalisation ON

Signedin & Personalisation ON

SIgnedout & Personalisation OFF
