adobe / adobe/adobe-client-data-layer
Capability to reset the data layer
- Dominant language
- JavaScript
- Stars
- 122
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
For web applications like SPA, it should be possible to simulate a reset of the data layer as when a new page is loaded. This is especially important in cases the Data Layer holds a lot of information and triggers many events because the array can then quickly become massive if a visitor actively browses around for a few minutes or more.
For example:
`adobeDataLayer.reset();`
A more detailed example:
```javascript
adobeDataLayer.push({ one: "some data" });
adobeDataLayer.length;
// 1
adobeDataLayer.getState();
// { one: "some data" }
adobeDataLayer.reset();
adobeDataLayer.length;
// 0
adobeDataLayer.getState();
// {}
```
Contributor guide
Assessment
This issue has not been assessed yet.