-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capability to instantiate multiple data layers #44
Comments
See also other ideas in #42 |
A proof of concept is available at: It works as follows:
You can also create a data layer instance programmatically once the data layer script is initialised:
|
@jckautzmann @gabrielwalt When this feature will be available in release? |
Hi @rajeevyadav2, |
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
The text was updated successfully, but these errors were encountered: