Skip to content

fix(container): no piano hit on refusal and manage cookies entry - #23306

Open
MehdiZaghouani wants to merge 7 commits into
masterfrom
fix/MANAGER-22813-cmp-consent
Open

MehdiZaghouani wants to merge 7 commits into
masterfrom
fix/MANAGER-22813-cmp-consent

Conversation

@MehdiZaghouani

Copy link
Copy Markdown
Contributor

Description

Two follow-ups on the OVHcloud CMP integration (#23251):

  • No hit to Piano when consent is refused. A refusal went through the same path as an acceptance: the tag was initialised, a cookie-banner-manager::decline click was sent and tracking was only disabled afterwards. Piano's beforeConsent mode lets every event through, so that hit really left. A refusal now disables tracking synchronously, drops queued hits and never initialises the tag. Hits emitted while tracking is disabled are dropped instead of queued, so a later opt-in from the CMP preferences does not replay the session.
  • "Manage cookies" entry in the account menu, mirroring the Manager V8: opens the CMP preferences modal. EU/CA only, and only once the CMP is actually up (hidden when the legacy modal took over).

Related

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.

🟡 Changes recommended

Stored refusal can leave startup hits available for later replay, and legacy navigation lacks the preferences action.

2 open findings
What changed in this PR

Updates CMP consent handling to prevent tracking on refusal and adds access to cookie preferences from the account menu.

Changes:

  • Disables tracking immediately on refusal and drops hits emitted while disabled.
  • Adds a CMP-ready “Manage cookies” action for EU/CA in reshuffled navigation.
  • Adds menu tests and translations for eight locales.
File Description
packages/​manager/​apps/​container/​src/​public/​translations/​user-account-menu/​Messages_pt_PT.json Portuguese menu label.
packages/​manager/​apps/​container/​src/​public/​translations/​user-account-menu/​Messages_pl_PL.json Polish menu label.
packages/​manager/​apps/​container/​src/​public/​translations/​user-account-menu/​Messages_it_IT.json Italian menu label.
packages/​manager/​apps/​container/​src/​public/​translations/​user-account-menu/​Messages_fr_FR.json French menu label.
packages/​manager/​apps/​container/​src/​public/​translations/​user-account-menu/​Messages_fr_CA.json Canadian French menu label.
packages/​manager/​apps/​container/​src/​public/​translations/​user-account-menu/​Messages_es_ES.json Spanish menu label.
packages/​manager/​apps/​container/​src/​public/​translations/​user-account-menu/​Messages_en_GB.json English menu label.
packages/​manager/​apps/​container/​src/​public/​translations/​user-account-menu/​Messages_de_DE.json German menu label.
packages/​manager/​apps/​container/​src/​container/​nav-reshuffle/​header/​user-account-menu/​Content.tsx Adds gated cookie preferences action.
packages/​manager/​apps/​container/​src/​container/​nav-reshuffle/​header/​user-account-menu/​constants.ts Adds menu tracking identifier.
packages/​manager/​apps/​container/​src/​container/​nav-reshuffle/​header/​Header.spec.tsx Tests preferences action and visibility.
packages/​components/​ovh-at-internet/​src/​ovh-at-internet.ts Changes refusal handling and tracking queues.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

{sidebarTranslation.t('sidebar_account_kyc_documents')}
</a>
)}
{isCookiePreferencesAvailable && (
Copilot AI balanced review requested due to automatic review settings October 15, 2026 12:47

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.

🔵 Needs a closer look

Privacy-sensitive shared tracking changes need human validation of refusal, subsequent opt-in, and legacy consent flows.

1 open finding
1 resolved since last review

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 15, 2026 12:57

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.

🔵 Needs a closer look

Shared consent handling needs human validation against the bundled Piano SDK across refusal, withdrawal, and subsequent opt-in.

1 open finding

🧠 Review effort: Balanced

@MehdiZaghouani
MehdiZaghouani changed the base branch from release/gcj-w40-v2 to master October 21, 2026 09:03
@MehdiZaghouani
MehdiZaghouani force-pushed the fix/MANAGER-22813-cmp-consent branch from bc06ca0 to aa916b1 Compare October 21, 2026 09:04
Copilot AI balanced review requested due to automatic review settings October 21, 2026 13:26
@MehdiZaghouani
MehdiZaghouani requested a review from a team as a code owner October 21, 2026 13:26
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Oct 21, 2026

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.

🟡 Changes recommended

Consent fallback, late CMP readiness, and Piano startup configuration leave unresolved privacy risks.

4 open issues

Review effort: Balanced

addEventURL: 'true',
cookieDomain: (window.location.hostname.match(/\..+/) || [])[0] || '',
campaignPrefix: ['at_'],
privacyDefaultMode: 'no-storage',
Comment on lines +131 to +134
setTimeout(() => {
if (!settled && !isApiReady()) failed = true;
settle();
}, CMP_READY_TIMEOUT_MS);
Comment on lines +91 to 93
const hasConsent = cookies[WEBSITE_PRIVACY_COOKIE_NAME]?.includes(WEBSITE_TRACKING_CONSENT_VALUE) ?? false;
if (hasConsent) {
trackingPlugin.init(true);
MehdiZaghouani and others added 7 commits November 3, 2026 14:07
)

ref: #MANAGER-22048
Signed-off-by: Mehdi Zaghouani <mehdi.zaghouani@corp.ovh.com>
A refusal went through the same path as an acceptance: the tag was
initialised, a "cookie-banner-manager::decline" click was sent to Piano
and tracking was only disabled afterwards. Piano's beforeConsent mode
lets every event through, so that hit really left.

A refusal now disables tracking synchronously, drops the hits queued
while the banner was on screen and never initialises the tag. Hits
emitted while tracking is disabled are dropped instead of queued, so a
user who refuses, browses, then opts in from the CMP preferences does
not get their whole session replayed to Piano.

ref: #MANAGER-22813
Signed-off-by: Mehdi Zaghouani <mehdi.zaghouani@corp.ovh.com>
Mirrors the Manager V8 account menu: a "Manage cookies" entry opens the
CMP preferences modal so the customer can review or withdraw consent at
any time. Only shown in EU/CA (no CMP elsewhere) and once the CMP is
actually up — when it failed and the legacy modal took over there are no
preferences to open.

ref: #MANAGER-22813
Signed-off-by: Mehdi Zaghouani <mehdi.zaghouani@corp.ovh.com>
On reload with a stored analytics refusal, the hits emitted before the
CMP is ready (boot MV test, first page views) are queued while the
tracker is still enabled, and the refusal only disables it. Opting in
later from the CMP preferences re-enabled the tracker and replayed that
queue to Piano.

Re-enabling a tracker that was disabled now clears the retained queue
first. A first-time consent still pending (tracker never disabled)
keeps its queued hits.

ref: #MANAGER-22813
Signed-off-by: Mehdi Zaghouani <mehdi.zaghouani@corp.ovh.com>
The legacy navigation is still served to EU/CA customers who have not
opted into the reshuffle, and CookiePolicy mounts the CMP for both
layouts, so they had no way to reopen their choices. The region and
CMP-readiness gate now lives in a shared useCookiePreferencesAvailable
hook used by both the reshuffled account menu and the legacy useful
links, which gain a "Manage cookies" action.

ref: #MANAGER-22813
Signed-off-by: Mehdi Zaghouani <mehdi.zaghouani@corp.ovh.com>
ref: #MANAGER-22815

Signed-off-by: Dustin Kroger <dustin.kroger.ext@ovhcloud.com>
Signed-off-by: Hazem Belkhiria <hazem.belkhiria.ext@ovhcloud.com>
@MehdiZaghouani
MehdiZaghouani force-pushed the fix/MANAGER-22813-cmp-consent branch from 72a105b to 122514e Compare November 3, 2026 13:07
Copilot AI balanced review requested due to automatic review settings November 3, 2026 13:07

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.

🟡 Changes recommended

Critical consent-handling gaps can leave tracking enabled after a late CMP refusal and allow the analytics SDK to store cookies before consent safeguards apply.

5 open issues

Review effort: Balanced

*/
private onUserConsentDeclined(): Promise<void> {
this.setEnabled(false);
this.clearTrackQueue();

This branch has not been deployed

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

Labels

bug Something isn't working common container dependencies Pull requests that update a dependency file translation required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants