feat(container): unify cookie consent with the OVHcloud CMP#23055
Open
MehdiZaghouani wants to merge 2 commits into
Open
feat(container): unify cookie consent with the OVHcloud CMP#23055MehdiZaghouani wants to merge 2 commits into
MehdiZaghouani wants to merge 2 commits into
Conversation
MehdiZaghouani
force-pushed
the
MANAGER-22048-container-cmp-integration
branch
from
July 24, 2026 07:55
22d2e51 to
dc1269c
Compare
added 2 commits
July 24, 2026 10:52
Loads the OVHcloud CMP (Consent Management Platform) from the container: declares window.__cmpConfig (locale, region, environment resolved from the hostname, fail-closed to preproduction) then injects the two-stage stable-name loader, and wraps the window.__cmp API (whenReady, getConsent, onConsentChange, showPreferences). The loader URLs come from the VITE_CMP_LOADER_URL and VITE_CMP_LOADER_URL_PREPROD build variables — the same build artifact is deployed to every environment, so both ship in the dist and the effective one is selected at runtime from the hostname; unset means the CMP is unavailable there and the legacy consent modal takes over. scripts is intentionally empty: Piano stays bundled and consent-gated by the tracking plugin — the CMP owns the consent UI and the cmp_consent cookie only. cmp:ready is armed before injection and time-bounded; isError() lets the caller fall back to the legacy modal. ref: #MANAGER-22048 Signed-off-by: Mehdi Zaghouani <mehdi.zaghouani@corp.ovh.com>
The CMP replaces the in-house consent modal for EU/CA: its banner and preferences modal own the consent UX, the cmp_consent cookie becomes the source of truth, and the Manager's single tracking consent maps to the CMP analytics category. CookiePolicy becomes a bridge: it applies the CMP choices to the shell tracking plugin (init / setEnabled / onUserConsentFromModal) so every child app, legacy iframes included, stays gated through the existing plugin RPC. The legacy TC_PRIVACY_CENTER modal is kept as an automatic fallback when the CMP cannot come up, and the US region keeps its auto-enabled behavior. ref: #MANAGER-22048 Signed-off-by: Mehdi Zaghouani <mehdi.zaghouani@corp.ovh.com>
MehdiZaghouani
force-pushed
the
MANAGER-22048-container-cmp-integration
branch
from
July 24, 2026 08:55
dc1269c to
5e3bdca
Compare
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.
Summary
Integrates the OVHcloud CMP (Consent Management Platform) into the container
app to unify cookie consent across OVHcloud properties (the website, the order
funnel and Manager V8 already use it). Two commits:
feat(container): add cmp facade to load the consent platform— a smallframework-agnostic facade (
src/cmp/) that declares the host context inwindow.__cmpConfigand injects the two-stage CMP loader.feat(container): drive tracking consent through the cmp—CookiePolicybecomes a bridge: the CMP banner replaces the in-house consent modal for
EU/CA and its choices drive the existing shell tracking plugin.
The Piano tracking stack is untouched: same bundled SDK, same tracking
plugin methods, same postMessage RPC for child apps (legacy iframes included).
Only the source of the consent boolean changes — the CMP instead of the
in-house
TC_PRIVACY_CENTERmodal.ref: #MANAGER-22048
Workflow
Key design points
analyticscategory;cmp_consentbecomes the source of truth (readexclusively through the
window.__cmpAPI, never parsed directly).manager.{eu,ca,us}.ovhcloud.com) loads the CMPfrom
www.ovhcloud.com(CORS-open, verified); every other hostname declarespreproduction(fail-closed) and loads the preprod CMP — local dev workswith zero setup.
cmp:readyis armed before injection and time-bounded(10 s); on loader error or timeout the legacy modal takes over
automatically, so consent collection survives a CMP outage.
lives in the legacy cookie, which the CMP does not read) — fresh consent
under the current policy version.
Tests
paths, the consent-change forwarding, and the 3 legacy-fallback scenarios).
banner replaces the legacy modal, accept/refuse drive Piano, preferences
modal, legacy fallback when the CMP host is blocked.