Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/analytics-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add optional pre-consent event queue to `AnalyticsController` (disabled by default via `isPreConsentQueueEnabled`), with a `consentDecisionMade` state field, `selectConsentDecisionMade` selector, and `resetConsentDecision` action ([#9252](https://github.com/MetaMask/core/pull/9252))

### Changed

- Bump `@metamask/utils` from `^11.9.0` to `^11.11.0` ([#9074](https://github.com/MetaMask/core/pull/9074))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export type AnalyticsControllerTrackViewAction = {

/**
* Opt in to analytics.
*
* Records that a consent decision has been made and replays any events that
* were queued while the user was undecided.
*/
export type AnalyticsControllerOptInAction = {
type: `AnalyticsController:optIn`;
Expand All @@ -51,12 +54,28 @@ export type AnalyticsControllerOptInAction = {

/**
* Opt out of analytics.
*
* Records that a consent decision has been made and discards any persisted
* events so nothing captured before the decision is ever delivered.
*/
export type AnalyticsControllerOptOutAction = {
type: `AnalyticsController:optOut`;
handler: AnalyticsController['optOut'];
};

/**
* Reset the consent decision back to undecided.
*
* Intended for client flows that restart onboarding. Clears the opt-in
* preference and discards both the delivery queue and any pre-consent events,
* so nothing captured before the reset is delivered and the user is treated
* as undecided again.
*/
export type AnalyticsControllerResetConsentDecisionAction = {
type: `AnalyticsController:resetConsentDecision`;
handler: AnalyticsController['resetConsentDecision'];
};

/**
* Union of all AnalyticsController action types.
*/
Expand All @@ -65,4 +84,5 @@ export type AnalyticsControllerMethodActions =
| AnalyticsControllerIdentifyAction
| AnalyticsControllerTrackViewAction
| AnalyticsControllerOptInAction
| AnalyticsControllerOptOutAction;
| AnalyticsControllerOptOutAction
| AnalyticsControllerResetConsentDecisionAction;
Loading
Loading