adobe / adobe/adobe-client-data-layer
Capability to instantiate multiple data layers
- Dominant language
- JavaScript
- Stars
- 122
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
It would be useful to be able to create different instances of the Data Layer that can be named as desired. The use-case is that customers might want to use the same Data Layer API to store other data that they don't want to mix with the main adobeDataLayer. For example, because this data has different privacy rules, and they can then better guarantee that this other data won't get sent to the same tracking services.
This requirement doesn't impact how we'd use the Data Layer in most cases, though. For example, in Core Components, which would always rely on the existence of a specific variable, like `adobeDataLayer`. But it means that the Data Layer API must not be a singleton, but should allow being instantiated multiple times. Is this possible already? For example:
`var myOtherData = new AdobeDataLayer();`
Allowing to make it an object we can instantiate would also help for unit testing it, for example.
This has been documented here:
https://github.com/adobe/adobe-client-data-layer/wiki/Adobe-Client-Data-Layer#new-instance
Contributor guide
Assessment
This issue has not been assessed yet.