Please correct me if I'm wrong. We are using the ACDL extension, which will automatically initialize the adobeDataLayer. So, the web application developers only have to worry about initializing the data layer, if they are adding some data before the Web SDK code loads. If they are only doing a "push" they obviously need to make the call after the Web SDK code loads. So, would it be a Best Practice to just have them initialize the adobeDataLayer regardless before the Web SDK code loads?
Thanks!
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @MichaelJo13
the beauty of the ACDL is that - like with GTM's "window.datalayer" - your developers can initialize the "window.adobeDataLayer" and push data and events to it at any time before Launch is loaded.
window.adobeDataLayer = window.adobeDataLayer || [];
// push some data to be present in the computed state
window.adobeDataLayer.push({
"hello": "world",
"foo": {
"bar": 1
}
});
// push a specific event
window.adobeDataLayer.push({
"event": "woohoo",
"eventInfo": {
"bla": "blub"
}
});
// async loaded Launch ready will process whatever has been pushed so far
This is best practice to avoid losing tracking calls. As soon as Launch and the extension loads, it will automatically enhance the previous definition with functions like getState()
Hope this answers your question
Hi @MichaelJo13
the beauty of the ACDL is that - like with GTM's "window.datalayer" - your developers can initialize the "window.adobeDataLayer" and push data and events to it at any time before Launch is loaded.
window.adobeDataLayer = window.adobeDataLayer || [];
// push some data to be present in the computed state
window.adobeDataLayer.push({
"hello": "world",
"foo": {
"bar": 1
}
});
// push a specific event
window.adobeDataLayer.push({
"event": "woohoo",
"eventInfo": {
"bla": "blub"
}
});
// async loaded Launch ready will process whatever has been pushed so far
This is best practice to avoid losing tracking calls. As soon as Launch and the extension loads, it will automatically enhance the previous definition with functions like getState()
Hope this answers your question
@MichaelJo13 Did you find the suggestion helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
It was helpful.
Thanks!
Views
Replies
Total Likes
Thank you!
Views
Replies
Total Likes
@MichaelJo13 yeah it is best practice to data layer ready before loading web SDK
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies