Skip to main content
Level 4
Feb 16, 2025 9:17 PM UTC
Solved

Timing of ACDL AdobeDataLayer?

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
bjoern-koth
bjoern-kothAccepted solution
Adobe Employee
Feb 17, 2025 6:51 AM UTC

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 

Cheers from Switzerland!

5 replies

bjoern-koth
Adobe Employee
bjoern-kothAdobe EmployeeAccepted solution
Adobe Employee
Feb 17, 2025 6:51 AM UTC

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 

Translate
Cheers from Switzerland!
kautuk_sahni
Level 9
Feb 17, 2025 11:13 AM UTC

@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!

Translate
Kautuk Sahni
Level 4
Feb 18, 2025 10:01 PM UTC

It was helpful.

Thanks!

Translate
Level 4
Feb 18, 2025 10:01 PM UTC

Thank you!

Translate
RiteshY18
Community Advisor
Community Advisor
Feb 19, 2025 3:28 AM UTC

@michaeljo13  yeah it is best practice to data layer ready before loading web SDK 

Translate