Skip to content

Latest commit

 

History

History
198 lines (127 loc) · 12.7 KB

CHANGELOG.md

File metadata and controls

198 lines (127 loc) · 12.7 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Changed

  • Bump @metamask/utils from ^12.0.2 to ^12.1.0 (#11796)

Added

  • Add marketingConsentSyncPending state to AnalyticsController to record a marketing consent choice made on this device that has not been saved to the user's account yet (#11469)
    • The field is persisted, defaults to false, and can be read with the new selectMarketingConsentSyncPending selector.
  • Add applyRemoteMarketingConsent method and AnalyticsController:applyRemoteMarketingConsent action (#11469)
    • Applies a marketing consent value read from the user's account, with the same side effects as optInToMarketing / optOutOfMarketing, without marking it as waiting to be saved.
    • Does nothing while a local choice is waiting to be saved, or if the same value is already decided.
  • Add clearMarketingConsentSyncPending method and AnalyticsController:clearMarketingConsentSyncPending action (#11469)
    • Clears marketingConsentSyncPending if local marketing consent still matches the given value, so a newer local choice stays pending.

Changed

  • Bump @metamask/utils from ^12.0.1 to ^12.0.2 (#11474)
  • optInToMarketing and optOutOfMarketing now set marketingConsentSyncPending to true in the same state update as the consent change (#11469)
  • resetMarketingConsentDecision now sets marketingConsentSyncPending to false (#11469)
  • Bump uuid from ^14.0.2 to ^14.0.3 (#11645)

Changed

  • Bump @metamask/config-registry-controller from ^5.0.0 to ^6.0.0 (#11447)

Added

  • Allow an optional properties argument on trackErrorAsAnalytics so callers can attach extra payload fields such as anonymous: true while keeping sanitized source and error_message (#11355)

Added

  • Add trackErrorAsAnalytics on AnalyticsController to report caught errors as Error Occurred events with a unique source and a sanitized error_message, bounded by sampling, deduplication, and a per-session cap (#11051)

Changed

Added

  • Add support for Node.js 26 (#10981)

Changed

  • Accept partial initial state as long as analyticsId is provided (#10901)
  • Bump @metamask/base-controller from ^10.0.0 to ^10.1.0 (#10864)

Changed

  • BREAKING: AnalyticsControllerMessenger requires ConfigRegistryController:getState in its allowed actions and ConfigRegistryController:stateChanged in its allowed events (#10448)
  • Update AnalyticsController.init to listen for ConfigRegistryController state changes and update in-memory event-purpose classification when the version differs (#10448)
  • Add @metamask/config-registry-controller ^4.0.0 as a dependency (#10448)
  • Bump lodash-es from ^4.17.21 to ^4.18.1 (#10447)
  • Bump @metamask/config-registry-controller from ^4.0.0 to ^5.0.0 (#10658)

Added

  • Add marketingCampaignCookieId state field and setMarketingCampaignCookieId action to AnalyticsController; the field is automatically set to null when the user calls optOutOfMarketing or resetMarketingConsentDecision (#10373)

Added

  • Add independent marketing consent and purpose-aware event classification (#10232)
    • Adds optedInToMarketing, optInToMarketing / optOutOfMarketing / resetMarketingConsentDecision, and a persisted eventsConfig whose unlisted events default to product-only
    • Named track and view payloads are delivered once with their allowed purposes in context.consent.categoryPreferences and their capture-time config version in context.eventsConfigVersion
    • Queues and fragments retain capture-time purpose classification so config changes cannot reclassify captured events. Mixed-purpose fragments classify each declared lifecycle event independently

Changed

  • Bump uuid from ^8.3.2 to ^11.1.1 (#10117, #10243)
  • Bump @metamask/utils from ^11.12.0 to ^12.0.0 (#10192)

Changed

  • BREAKING: Drop CommonJS support (#9536)
    • This package is now ESM-only, but can still be used in CommonJS projects via require(esm) in modern Node.js versions (22+), or dynamic imports in older Node.js versions.
  • BREAKING: Bump minimum Node.js version to 22 (#9976)
  • BREAKING: Bump TypeScript target to ES2022 (#10019)
    • This package now ships ES2022 code, requiring a compatible modern environment or bundler configuration to consume.
  • Bump @metamask/base-controller from ^9.1.0 to ^10.0.0 (#10160)
  • Bump @metamask/geolocation-controller from ^1.0.0 to ^2.0.0 (#10160)
  • Bump @metamask/messenger from ^2.0.0 to ^3.0.0 (#10160)

Added

  • Add optional event fragments to AnalyticsController (disabled by default via isEventFragmentsEnabled), letting clients accumulate analytics properties across a user journey and optionally emit an initial, success, or failure event for it (#10055)

Changed

  • Bump @metamask/utils from ^11.11.0 to ^11.12.0 (#10076)

Changed

  • BREAKING: Optionally enrich non-anonymous track, identify, and view payloads with the user's country_code, region, and timezone under context.location, gated behind the new isGeolocationEnabled constructor option (default false) (#9691, #9728)
    • AnalyticsController.init and AnalyticsController.optIn are now asynchronous and return a Promise<void>, so await them before tracking events
    • When enabled, geolocation is resolved via GeolocationController:getGeolocationData (which compositions must register) only after the user opts in, so location is never requested before they consent to analytics; queued pre-consent events are then enriched on replay (anonymous payloads excluded)
    • Adds @metamask/geolocation-controller ^0.1.3 as a dependency
  • Bump @metamask/messenger from ^1.2.0 to ^2.0.0 (#9392)
  • Bump @metamask/geolocation-controller from ^0.1.3 to ^1.0.0 (#9735)

Changed

  • Preserve the pre-consent event queue when calling resetConsentDecision, matching extension behavior for undecided consent resets during onboarding restarts (#9284)

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)

Changed

  • Bump @metamask/utils from ^11.9.0 to ^11.11.0 (#9074)

Fixed

  • Clear persisted analytics event queue entries after the delivery callback runs, including when the callback reports an error. (#8934)

Added

  • Optional persisted event queue support in AnalyticsController, disabled by default. (#8797)
  • Add optional analytics context on trackEvent, identify, and trackView to forward platform-specific context to AnalyticsPlatformAdapter implementations (#8835)
  • Optional skipUUIDv4Check on AnalyticsPlatformAdapter to allow non-UUIDv4 analyticsId strings when constructing AnalyticsController (#8543)

Changed

  • Mark analyticsId as persisted (persist: true) in AnalyticsController state metadata so it is saved and restored with optedIn when using a persisted controller composition (#8542)
  • Bump @metamask/messenger from ^1.0.0 to ^1.2.0 (#8364, #8373, #8632)
  • Bump @metamask/base-controller from ^9.0.1 to ^9.1.0 (#8457)

Changed

  • Bump @metamask/base-controller from ^9.0.0 to ^9.0.1 (#8317)
  • Bump @metamask/messenger from ^0.3.0 to ^1.0.0 (#8317)
  • Upgrade @metamask/utils from ^11.8.1 to ^11.9.0 (#7511)

Added

  • Initial release of @metamask/analytics-controller. (#7017, #7202)