New Features
- Deep-merge tracking data (#14) We now do a deep-merge of the tracking data. Previously we were doing a shallow-merge which meant that tracking data that shared a subkey would "lose" to the deepest version.
- Exporting
TrackingPropTypes
(#18) you can now import the PropTypes definition for thetracking
context object, if needed. options.dispatchOnMount
(#16) The "auto-dispatch" behavior is now opt-in. See Breaking Changes below for more info.
Breaking Changes
We no longer "auto-dispatch" when seeing tracking data like { page: 'FooPage' }
. Instead you can opt-in to auto-dispatching by passing in options.dispatchOnMount
, which will dispatch the tracking data when the component mounts. Like so:
@track({ page: 'FooPage' }, { dispatchOnMount: true })
export default class FooPage extends Component { ... }
This also means the previous behavior of automatically including { event: 'pageDataReady' }
is no longer the case, and if this needs to be part of your tracking data you will have to manually include it where necessary.
See the README for more info.