Timing of ACDL AdobeDataLayer? | Community
Skip to main content
Level 4
February 16, 2025
Solved

Timing of ACDL AdobeDataLayer?

  • February 16, 2025
  • 4 replies
  • 731 views

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.
Best answer by bjoern__koth

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 

4 replies

bjoern__koth
Community Advisor and Adobe Champion
bjoern__kothCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
February 17, 2025

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!
kautuk_sahni
Community Manager
Community Manager
February 17, 2025

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

Kautuk Sahni
Level 4
February 18, 2025

It was helpful.

Thanks!

Level 4
February 18, 2025

Thank you!

RiteshY18
Community Advisor
Community Advisor
February 19, 2025

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