Skip to content

feat(account): add pixel tracking consent checkbox on account edition - #23203

Open
AlexisAfonso wants to merge 2 commits into
masterfrom
manager-tracking-pixel
Open

feat(account): add pixel tracking consent checkbox on account edition#23203
AlexisAfonso wants to merge 2 commits into
masterfrom
manager-tracking-pixel

Conversation

@AlexisAfonso

Copy link
Copy Markdown
Contributor

Add a country-gated pixel-tracking consent checkbox next to the existing marketing-email checkbox on the account edition form. It is offered to France (all of its territory) and Italy accounts only, and never renders anywhere else: outside that scope no rule is built at all.

The checkbox is unchecked by default and stays disabled while marketing-email consent is not granted, since the API refuses that combination outright. Unchecking marketing email clears and disables it in the same UI update, and re-checking marketing email leaves it unchecked: re-subscribing to email never restores pixel tracking, so the customer has to opt back in explicitly.

Both consent states travel together in a single
PUT /me/consent/consent-marketing-email/decision, which the fixed processing order makes safe, and the pixel key is omitted entirely when marketing email is revoked so the backend cascade applies. A refused pair re-fetches the decision and repaints both checkboxes rather than trusting the local state.

The country list, the country predicate, the pixel.value reader and the payload builder live in a framework-free module so the account creation screen can reuse them as is.

ref: #MANAGER-22481

Signed-off-by: Alexis AFONSO alexis.afonso@ovhcloud.com

Add a country-gated pixel-tracking consent checkbox next to the existing
marketing-email checkbox on the account edition form. It is offered to France
(all of its territory) and Italy accounts only, and never renders anywhere
else: outside that scope no rule is built at all. The country is re-read from
the form on every field change rather than frozen at load, so editing the
country select takes the checkbox away as soon as it leaves the scope and
brings it back on return. The unsaved choice leaves with it, so a checkbox the
customer can no longer see never travels in the payload, and coming back into
scope rebuilds the box from the decision the GET returned.

The checkbox is unchecked by default and stays disabled while marketing-email
consent is not granted, since the API refuses that combination outright.
Unchecking marketing email clears and disables it in the same UI update, and
re-checking marketing email leaves it unchecked: re-subscribing to email never
restores pixel tracking, so the customer has to opt back in explicitly.

Its label names the mailbox the pixels would measure, and names the REGISTERED
address rather than the one being typed into the email field above: a new
address receives nothing until the customer confirms the changeEmail procedure
from the current mailbox.

Both consent states travel together in a single
PUT /me/consent/consent-marketing-email/decision, which the fixed processing
order makes safe, and the pixel key is omitted entirely when marketing email
is revoked so the backend cascade applies. A refused pair re-fetches the
decision and repaints both checkboxes rather than trusting the local state.

The country list, the country predicate, the pixel.value reader and the
payload builder live in a framework-free module so the account creation screen
can reuse them as is.

Pin the ui-kit checkbox icon against flex shrinking while here. It is a flex
item in a row whose text can overflow, so a label long enough to wrap squeezed
its box from 16px down to 4px while the square it paints, an absolutely
positioned ::before, kept its 1rem: the text slid under the square and read as
glued to it. Every checkbox of the form now shares the same box and gap.

Only fr_FR is translated; the remaining locales are left to the CDS bot.

ref: #MANAGER-22481
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Alexis AFONSO <alexis.afonso@ovhcloud.com>
Signed-off-by: CDS Translator Agent <opensource@ovh.net>
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