fix(consent): la medición propia siempre activa; rechazar marketing ya no recarga la página
Claude-Session: https://claude.ai/code/session_01UNZxBnD6dnMGEdbvBVwoS7
This commit is contained in:
parent
96f0139861
commit
5cc3d46997
1 changed files with 3 additions and 7 deletions
|
|
@ -116,7 +116,8 @@ export function setConsent(choice) {
|
|||
v: VERSION,
|
||||
ts: new Date().toISOString(),
|
||||
necessary: true,
|
||||
analytics: !!choice.analytics,
|
||||
// First-party measurement is always on (exempt); only marketing is a choice.
|
||||
analytics: true,
|
||||
marketing: !!choice.marketing,
|
||||
};
|
||||
try {
|
||||
|
|
@ -125,12 +126,7 @@ export function setConsent(choice) {
|
|||
|
||||
listeners.forEach((fn) => { try { fn(getConsent()); } catch (_) { /* ignore */ } });
|
||||
|
||||
if (next.analytics && !before.analytics) {
|
||||
applyConsent();
|
||||
} else if (!next.analytics && before.analytics) {
|
||||
try { window.op && window.op('clear'); } catch (_) { /* ignore */ }
|
||||
try { window.location.reload(); } catch (_) { /* ignore */ }
|
||||
}
|
||||
return getConsent();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue