Repository navigation
New consent_mode init option
·
20 commits
to master
since this release
Immutable
release. Only release title and notes can be modified.
New: consent_mode: 'require_consent'
A stricter consent mode for sites that must collect consent before anything is stored or sent:
mixpanel.init(TOKEN, { consent_mode: 'require_consent' });
// ...after the visitor accepts:
mixpanel.opt_in_tracking();- Before consent: nothing is stored or sent. That covers events, people and group updates, feature flag fetches, remote settings and session recording. An
identify()made before consent is held and applied on opt-in. - On
opt_out_tracking()or Do Not Track (unlessignore_dntis set): the SDK stops on the page at once and deletes stored identifiers, queued batches and persisted flag variants. Unsent session replay data stays on the device and is only uploaded once consent is given again. - Where the decision is stored: with the identity persistence (
persistenceconfig), so subdomains that share the cookie also share the decision.opt_out_tracking_cookie_prefixstill names the stored flag. - Unrecognized values: an unknown
consent_modeis treated as'require_consent', so a typo collects nothing.
Upgrading from the opt_out_* configs
- If you leave
consent_modeunset, opt-out works exactly as in 2.84.0. opt_out_tracking_by_defaultonly applies whenconsent_modeis unset. Settingconsent_modeto anything, including'no_consent_required', turns it off.- Under
require_consent, these are ignored:opt_out_tracking_by_default,opt_out_tracking_persistence_typeandopt_out_persistence_by_default- the persistence options of
opt_in_tracking()andopt_out_tracking() delete_user: an opt-out removes local data only and doesn't delete the user's profile on the server.
Fixes
- After
opt_out_tracking(), a laterset_config()call no longer starts writing super properties to cookie or localStorage again. - Session replays keep the spaces between inline elements. Before, the mask function dropped them and adjacent words ran together.
init()no longer creates an emptymixpanelFlagsDbIndexedDB database when no flag variants have been saved.